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

com.blazebit.persistence.criteria.BlazeFetchParent Maven / Gradle / Ivy

There is a newer version: 1.6.12
Show newest version
/*
 * Copyright 2014 - 2021 Blazebit.
 *
 * 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
 *
 *      http://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 com.blazebit.persistence.criteria;

import javax.persistence.criteria.FetchParent;
import javax.persistence.criteria.JoinType;
import javax.persistence.metamodel.PluralAttribute;
import javax.persistence.metamodel.SingularAttribute;

/**
 * An extended version of {@link FetchParent}.
 *
 * @param  The source type
 * @param  The target type
 * @author Christian Beikov
 * @since 1.2.0
 */
public interface BlazeFetchParent extends FetchParent {

    /* Aliased fetch joins */

    /**
     * Like {@link FetchParent#fetch(SingularAttribute)} but allows to set the alias of the {@link BlazeJoin}.
     *
     * @param attribute The target of the join
     * @param alias     The alias for the {@link BlazeJoin}
     * @param        The type of the join relation
     * @return The resulting fetch join
     */
     BlazeJoin fetch(SingularAttribute attribute, String alias);

    /**
     * Like {@link FetchParent#fetch(SingularAttribute, JoinType)} but allows to set the alias of the {@link BlazeJoin}.
     *
     * @param attribute The target of the join
     * @param alias     The alias for the {@link BlazeJoin}
     * @param jt        The join type
     * @param        The type of the join relation
     * @return The resulting fetch join
     */
     BlazeJoin fetch(SingularAttribute attribute, String alias, JoinType jt);

    /**
     * Like {@link FetchParent#fetch(PluralAttribute)} but allows to set the alias of the {@link BlazeJoin}.
     *
     * @param attribute The target of the join
     * @param alias     The alias for the {@link BlazeJoin}
     * @param        The type of the join relation
     * @return The resulting fetch join
     */
     BlazeJoin fetch(PluralAttribute attribute, String alias);

    /**
     * Like {@link FetchParent#fetch(PluralAttribute, JoinType)} but allows to set the alias of the {@link BlazeJoin}.
     *
     * @param attribute The target of the join
     * @param alias     The alias for the {@link BlazeJoin}
     * @param jt        The join type
     * @param        The type of the join relation
     * @return The resulting fetch join
     */
     BlazeJoin fetch(PluralAttribute attribute, String alias, JoinType jt);

    /**
     * Like {@link FetchParent#fetch(String)} but allows to set the alias of the {@link BlazeJoin}.
     *
     * @param attributeName The target of the join
     * @param alias         The alias for the {@link BlazeJoin}
     * @param            The source type of the join relation
     * @param            The type of the join relation
     * @return The resulting fetch join
     */
    @SuppressWarnings("hiding")
     BlazeJoin fetch(String attributeName, String alias);

    /**
     * Like {@link FetchParent#fetch(String, JoinType)} but allows to set the alias of the {@link BlazeJoin}.
     *
     * @param attributeName The target of the join
     * @param alias         The alias for the {@link BlazeJoin}
     * @param jt            The join type
     * @param            The source type of the join relation
     * @param            The type of the join relation
     * @return The resulting fetch join
     */
    @SuppressWarnings("hiding")
     BlazeJoin fetch(String attributeName, String alias, JoinType jt);

    /* Covariant overrides */

    /**
     * Like {@link FetchParent#fetch(SingularAttribute)} but returns the subtype {@link BlazeJoin} instead.
     *
     * @param attribute The target of the join
     * @param        The type of the join relation
     * @return The resulting fetch join
     */
     BlazeJoin fetch(SingularAttribute attribute);

    /**
     * Like {@link FetchParent#fetch(SingularAttribute, JoinType)} but returns the subtype {@link BlazeJoin} instead.
     *
     * @param attribute The target of the join
     * @param jt        The join type
     * @param        The type of the join relation
     * @return The resulting fetch join
     */
     BlazeJoin fetch(SingularAttribute attribute, JoinType jt);

    /**
     * Like {@link FetchParent#fetch(PluralAttribute)} but returns the subtype {@link BlazeJoin} instead.
     *
     * @param attribute The target of the join
     * @param        The type of the join relation
     * @return The resulting fetch join
     */
     BlazeJoin fetch(PluralAttribute attribute);

    /**
     * Like {@link FetchParent#fetch(PluralAttribute, JoinType)} but returns the subtype {@link BlazeJoin} instead.
     *
     * @param attribute The target of the join
     * @param jt        The join type
     * @param        The type of the join relation
     * @return The resulting fetch join
     */
     BlazeJoin fetch(PluralAttribute attribute, JoinType jt);

    /**
     * Like {@link FetchParent#fetch(String)} but returns the subtype {@link BlazeJoin} instead.
     *
     * @param attributeName The target of the join
     * @param            The source type of the join relation
     * @param            The type of the join relation
     * @return The resulting fetch join
     */
    @SuppressWarnings("hiding")
     BlazeJoin fetch(String attributeName);

    /**
     * Like {@link FetchParent#fetch(String, JoinType)} but returns the subtype {@link BlazeJoin} instead.
     *
     * @param attributeName The target of the join
     * @param jt            The join type
     * @param            The source type of the join relation
     * @param            The type of the join relation
     * @return The resulting fetch join
     */
    @SuppressWarnings("hiding")
     BlazeJoin fetch(String attributeName, JoinType jt);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy