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

com.querydsl.jpa.JPQLQueryFactory Maven / Gradle / Ivy

There is a newer version: 5.1.0
Show newest version
/*
 * Copyright 2015, The Querydsl Team (http://www.querydsl.com/team)
 *
 * 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.querydsl.jpa;

import com.querydsl.core.QueryFactory;
import com.querydsl.core.Tuple;
import com.querydsl.core.dml.DeleteClause;
import com.querydsl.core.dml.InsertClause;
import com.querydsl.core.dml.UpdateClause;
import com.querydsl.core.types.EntityPath;
import com.querydsl.core.types.Expression;

/**
 * Common interface for JPA related QueryFactory implementations
 *
 * @author tiwe
 *
 */
public interface JPQLQueryFactory extends QueryFactory> {

    /**
     * Create a new DELETE clause
     *
     * @param path entity to delete from
     * @return delete clause
     */
    DeleteClause delete(EntityPath path);

    /**
     * Create a new JPQLQuery instance with the given projection
     *
     * @param expr projection
     * @param 
     * @return select(expr)
     */
     JPQLQuery select(Expression expr);

    /**
     * Create a new JPQLQuery instance with the given projection
     *
     * @param exprs projection
     * @return select(exprs)
     */
    JPQLQuery select(Expression... exprs);

    /**
     * Create a new JPQLQuery instance with the given projection
     *
     * @param expr projection
     * @param 
     * @return select(distinct expr)
     */
     JPQLQuery selectDistinct(Expression expr);

    /**
     * Create a new JPQLQuery instance with the given projection
     *
     * @param exprs projection
     * @return select(distinct exprs)
     */
    JPQLQuery selectDistinct(Expression... exprs);

    /**
     * Create a new JPQLQuery instance with the projection one
     *
     * @return select(1)
     */
    JPQLQuery selectOne();

    /**
     * Create a new JPQLQuery instance with the projection zero
     *
     * @return select(0)
     */
    JPQLQuery selectZero();

    /**
     * Create a new JPQLQuery instance with the given source and projection
     *
     * @param from projection and source
     * @param 
     * @return select(from).from(from)
     */
     JPQLQuery selectFrom(EntityPath from);

    /**
     * Create a new Query with the given source
     *
     * @param from from
     * @return from(from)
     */
    JPQLQuery from(EntityPath from);

    /**
     * Create a new Query with the given source
     *
     * @param from from
     * @return from(from)
     */
    JPQLQuery from(EntityPath... from);

    /**
     * Create a new UPDATE clause
     *
     * @param path entity to update
     * @return update clause
     */
    UpdateClause update(EntityPath path);

    /**
     * Create a new INSERT clause
     *
     * @param path entity to insert to
     * @return insert clause
     */
    InsertClause insert(EntityPath path);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy