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

com.blazebit.persistence.criteria.BlazeCriteriaQuery 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 com.blazebit.persistence.CriteriaBuilder;

import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Expression;
import javax.persistence.criteria.Order;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Selection;
import java.util.List;

/**
 * An extended version of {@link CriteriaQuery}.
 *
 * @param  the type of the defined result
 * @author Christian Beikov
 * @since 1.2.0
 */
public interface BlazeCriteriaQuery extends CriteriaQuery, BlazeAbstractQuery {

    /**
     * Create a Blaze-Persistence Core {@link CriteriaBuilder} from this query.
     *
     * @param entityManager The entity manager to which to bind the criteria builder
     * @return A new criteria builder
     */
    public CriteriaBuilder createCriteriaBuilder(EntityManager entityManager);

    /**
     * The extended JPA {@link javax.persistence.criteria.CriteriaBuilder} associated with this query.
     *
     * @return The JPA {@link javax.persistence.criteria.CriteriaBuilder}
     */
    public BlazeCriteriaBuilder getCriteriaBuilder();

    /**
     * Like {@link CriteriaQuery#getOrderList()} but returns the subtype {@link BlazeOrder} instead.
     *
     * @return The list of ordering expressions
     */
    public List getBlazeOrderList();
    
    /* Covariant overrides */

    @Override
    BlazeCriteriaQuery select(Selection selection);

    @Override
    BlazeCriteriaQuery multiselect(Selection... selections);

    @Override
    BlazeCriteriaQuery multiselect(List> selectionList);

    @Override
    BlazeCriteriaQuery where(Expression restriction);

    @Override
    BlazeCriteriaQuery where(Predicate... restrictions);

    @Override
    BlazeCriteriaQuery groupBy(Expression... grouping);

    @Override
    BlazeCriteriaQuery groupBy(List> grouping);

    @Override
    BlazeCriteriaQuery having(Expression restriction);

    @Override
    BlazeCriteriaQuery having(Predicate... restrictions);

    @Override
    BlazeCriteriaQuery orderBy(Order... o);

    @Override
    BlazeCriteriaQuery orderBy(List o);

    @Override
    BlazeCriteriaQuery distinct(boolean distinct);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy