All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.micronaut.data.model.jpa.criteria.PersistentEntityFrom Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2017-2021 original authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.micronaut.data.model.jpa.criteria;

import io.micronaut.core.annotation.Experimental;
import io.micronaut.core.annotation.NonNull;
import io.micronaut.core.annotation.Nullable;
import io.micronaut.data.annotation.Join;

import jakarta.persistence.criteria.From;
import jakarta.persistence.criteria.JoinType;
import jakarta.persistence.metamodel.CollectionAttribute;
import jakarta.persistence.metamodel.ListAttribute;
import jakarta.persistence.metamodel.SetAttribute;
import jakarta.persistence.metamodel.SingularAttribute;

import java.util.Collection;

/**
 * The persistent entity {@link From}.
 *
 * @param             The association owner type
 * @param  The association entity type
 * @author Denis Stepanov
 * @since 3.2
 */
@Experimental
public interface PersistentEntityFrom extends From, PersistentEntityPath {

    /**
     * @return The persistent joins
     */
    @NonNull
    Collection> getPersistentJoins();

    @Override
    @Nullable
     PersistentEntityJoin join(@NonNull String attributeName);

    /**
     * Joins the entity with specific join type.
     *
     * @param attributeName The joined associated property
     * @param joinType      The join type
     * @param            The association owner type
     * @param            The association entity type
     * @return The joined entity
     */
    @NonNull
     PersistentEntityJoin join(@NonNull String attributeName, @NonNull Join.Type joinType);

    /**
     * Joins the entity with specific join type.
     *
     * @param attributeName The joined associated property
     * @param joinType      The join type
     * @param alias         The join alias
     * @param            The association owner type
     * @param            The association entity type
     * @return The joined entity
     */
    @NonNull
     PersistentEntityJoin join(@NonNull String attributeName, @NonNull Join.Type joinType, @NonNull String alias);

    @NonNull
    @Override
     PersistentEntityJoin join(@NonNull String attributeName, @NonNull JoinType jt);

    @NonNull
    @Override
     PersistentEntityJoin join(@NonNull SingularAttribute attribute, @NonNull JoinType jt);

    @NonNull
    @Override
     PersistentEntityJoin join(@NonNull SingularAttribute attribute);

    @NonNull
    @Override
     PersistentEntityCollectionJoin join(@NonNull CollectionAttribute collection, @NonNull JoinType jt);

    @NonNull
    @Override
     PersistentEntityCollectionJoin join(@NonNull CollectionAttribute collection);

    @NonNull
    @Override
     PersistentEntityListJoin join(@NonNull ListAttribute list);

    @NonNull
    @Override
     PersistentEntityListJoin join(@NonNull ListAttribute list, @NonNull JoinType jt);

    @NonNull
    @Override
     PersistentEntityListJoin joinList(@NonNull String attributeName);

    @NonNull
    @Override
     PersistentEntityListJoin joinList(@NonNull String attributeName, @NonNull JoinType jt);

    @NonNull
    @Override
     PersistentEntityCollectionJoin joinCollection(@NonNull String attributeName);

    @NonNull
    @Override
     PersistentEntityCollectionJoin joinCollection(@NonNull String attributeName, @NonNull JoinType jt);

    @NonNull
    @Override
     PersistentEntitySetJoin join(@NonNull SetAttribute set);

    @NonNull
    @Override
     PersistentEntitySetJoin join(@NonNull SetAttribute set, @NonNull JoinType jt);

    @NonNull
    @Override
     PersistentEntitySetJoin joinSet(@NonNull String attributeName);

    @NonNull
    @Override
     PersistentEntitySetJoin joinSet(@NonNull String attributeName, @NonNull JoinType jt);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy