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

cz.encircled.joiner.query.JoinerQuery Maven / Gradle / Ivy

package cz.encircled.joiner.query;

import com.querydsl.core.types.EntityPath;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.Predicate;
import cz.encircled.joiner.query.join.JoinDescription;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Set;

/**
 * Base interface which defines possible parameters of joiner query
 * T - select from
 * R - projection type
 *
 * @author Vlad on 04-Sep-16.
 */
public interface JoinerQuery extends JoinRoot {

    EntityPath getFrom();

    Expression getReturnProjection();

    JoinerQueryBase where(Predicate where);

    Predicate getWhere();

    JoinerQueryBase distinct(boolean isDistinct);

    boolean isDistinct();

    JoinerQueryBase groupBy(Path groupBy);

    Path getGroupBy();

    JoinerQueryBase having(Predicate having);

    Predicate getHaving();

    /**
     * Add join graphs to the query.
     *
     * @param names names of join graphs
     * @return this
     * @see cz.encircled.joiner.query.join.JoinGraphRegistry
     */
    JoinerQueryBase joinGraphs(String... names);

    /**
     * Add join graphs to the query.
     *
     * @param names names of join graphs
     * @return this
     * @see cz.encircled.joiner.query.join.JoinGraphRegistry
     */
    JoinerQueryBase joinGraphs(Enum... names);

    /**
     * Add join graphs to the query.
     *
     * @param names names of join graphs
     * @return this
     * @see cz.encircled.joiner.query.join.JoinGraphRegistry
     */
    JoinerQueryBase joinGraphs(Collection names);

    Set getJoinGraphs();

    /**
     * Add left joins for specified paths
     *
     * @param paths join paths
     * @return this
     */
    JoinerQueryBase joins(EntityPath... paths);

    JoinerQueryBase joins(JoinDescription... joins);

    JoinerQueryBase joins(Collection joins);

    Collection getJoins();

    JoinerQueryBase addHint(String hint, Object value);

    LinkedHashMap> getHints();

    JoinerQueryBase addFeatures(QueryFeature... features);

    JoinerQueryBase addFeatures(Collection features);

    List getFeatures();

    /**
     * Set offset for the query results
     *
     * @param offset value
     * @return this
     */
    JoinerQueryBase offset(Long offset);

    Long getOffset();

    /**
     * Set max results for the query results
     *
     * @param limit value
     * @return this
     */
    JoinerQueryBase limit(Long limit);

    Long getLimit();

    JoinerQueryBase asc(Expression orderBy);

    JoinerQueryBase desc(Expression orderBy);

    List getOrder();

    JoinerQuery copy();

    boolean isCount();

}