T - the type of the sub query.public class SubqueryImpl<T> extends AbstractExpression<T> implements javax.persistence.criteria.Subquery<T>, BaseQuery<T>
| Constructor and Description |
|---|
SubqueryImpl(MetamodelImpl metamodel,
BaseQueryImpl<?> parent,
Class<T> javaType) |
| Modifier and Type | Method and Description |
|---|---|
<X,Y> javax.persistence.criteria.CollectionJoin<X,Y> |
correlate(javax.persistence.criteria.CollectionJoin<X,Y> parentCollection) |
<X,Y> javax.persistence.criteria.Join<X,Y> |
correlate(javax.persistence.criteria.Join<X,Y> parentJoin) |
<X,Y> javax.persistence.criteria.ListJoin<X,Y> |
correlate(javax.persistence.criteria.ListJoin<X,Y> parentList) |
<X,K,V> javax.persistence.criteria.MapJoin<X,K,V> |
correlate(javax.persistence.criteria.MapJoin<X,K,V> parentMap) |
<Y> javax.persistence.criteria.Root<Y> |
correlate(javax.persistence.criteria.Root<Y> parentRoot) |
<X,Y> javax.persistence.criteria.SetJoin<X,Y> |
correlate(javax.persistence.criteria.SetJoin<X,Y> parentSet) |
SubqueryImpl<T> |
distinct(boolean distinct) |
<X> javax.persistence.criteria.Root<X> |
from(Class<X> entityClass) |
<X> javax.persistence.criteria.Root<X> |
from(javax.persistence.metamodel.EntityType<X> entity) |
String |
generateJpql()
Generates the JPQL for the query.
|
String |
generateJpqlRestriction(BaseQueryImpl<?> query)
Returns the JPQL where fragment.
|
String |
generateJpqlSelect(AbstractCriteriaQueryImpl<?> query,
boolean selected)
Returns the JPQL select fragment.
|
String |
generateSql()
Returns the generated SQL.
|
String |
generateSqlSelect(AbstractCriteriaQueryImpl<?> query,
boolean selected)
Returns the SQL select fragment.
|
String |
generateTableAlias(boolean entity)
Returns the generated entity alias.
|
Integer |
getAlias(AbstractParameterExpressionImpl<?> parameter)
Returns the generated alias for the parameter.
|
String |
getAlias(AbstractSelection<?> selection)
Returns the generated alias for the selection.
|
Set<javax.persistence.criteria.Join<?,?>> |
getCorrelatedJoins() |
String |
getFieldAlias(String tableAlias,
AbstractColumn column) |
List<javax.persistence.criteria.Expression<?>> |
getGroupList() |
javax.persistence.criteria.Predicate |
getGroupRestriction() |
JdbcAdaptor |
getJdbcAdaptor()
Returns the JDBC Adaptor.
|
String |
getJpql()
Returns the JPQL for the query.
|
MetamodelImpl |
getMetamodel()
Returns the metamodel.
|
AbstractParameterExpressionImpl<?> |
getParameter(int position)
Returns the parameter at position.
|
Set<javax.persistence.criteria.ParameterExpression<?>> |
getParameters()
Returns the parameters of the query.
|
javax.persistence.criteria.AbstractQuery<?> |
getParent() |
javax.persistence.criteria.Predicate |
getRestriction() |
Class<T> |
getResultType() |
Set<javax.persistence.criteria.Root<?>> |
getRoots() |
javax.persistence.criteria.Expression<T> |
getSelection() |
String |
getSql()
Returns the SQL for the query.
|
List<AbstractParameterExpressionImpl<?>> |
getSqlParameters()
Returns the SQL parameters of the query.
|
String[] |
getSqlRestrictionFragments(BaseQueryImpl<?> query)
Returns the SQL restriction fragments.
|
SubqueryImpl<T> |
groupBy(javax.persistence.criteria.Expression<?>... grouping) |
SubqueryImpl<T> |
groupBy(List<javax.persistence.criteria.Expression<?>> grouping) |
T |
handle(QueryImpl<?> query,
SessionImpl session,
ResultSet row)
Handles the row.
|
SubqueryImpl<T> |
having(javax.persistence.criteria.Expression<Boolean> restriction) |
SubqueryImpl<T> |
having(javax.persistence.criteria.Predicate... restrictions) |
boolean |
isDistinct() |
javax.persistence.criteria.Subquery<T> |
select(javax.persistence.criteria.Expression<T> expression) |
int |
setNextSqlParam(AbstractParameterExpressionImpl<?> parameter)
Adds the parameter to the SQL parameters queue.
|
<U> SubqueryImpl<U> |
subquery(Class<U> type)
Create a subquery of the query.
|
String |
toString() |
javax.persistence.criteria.Subquery<T> |
where(javax.persistence.criteria.Expression<Boolean> restriction) |
javax.persistence.criteria.Subquery<T> |
where(javax.persistence.criteria.Predicate... restrictions) |
as, getConverter, in, in, in, in, isNotNull, isNull, setConverteralias, getAlias, getCompoundSelectionItems, isCompoundSelection, isEntityListgetJavaTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitas, in, in, in, in, isNotNull, isNullpublic SubqueryImpl(MetamodelImpl metamodel, BaseQueryImpl<?> parent, Class<T> javaType)
metamodel - the metamodelparent - the parent queryjavaType - the java typepublic <X,Y> javax.persistence.criteria.CollectionJoin<X,Y> correlate(javax.persistence.criteria.CollectionJoin<X,Y> parentCollection)
correlate in interface javax.persistence.criteria.Subquery<T>public <X,Y> javax.persistence.criteria.Join<X,Y> correlate(javax.persistence.criteria.Join<X,Y> parentJoin)
correlate in interface javax.persistence.criteria.Subquery<T>public <X,Y> javax.persistence.criteria.ListJoin<X,Y> correlate(javax.persistence.criteria.ListJoin<X,Y> parentList)
correlate in interface javax.persistence.criteria.Subquery<T>public <X,K,V> javax.persistence.criteria.MapJoin<X,K,V> correlate(javax.persistence.criteria.MapJoin<X,K,V> parentMap)
correlate in interface javax.persistence.criteria.Subquery<T>public <Y> javax.persistence.criteria.Root<Y> correlate(javax.persistence.criteria.Root<Y> parentRoot)
correlate in interface javax.persistence.criteria.Subquery<T>public <X,Y> javax.persistence.criteria.SetJoin<X,Y> correlate(javax.persistence.criteria.SetJoin<X,Y> parentSet)
correlate in interface javax.persistence.criteria.Subquery<T>public SubqueryImpl<T> distinct(boolean distinct)
public <X> javax.persistence.criteria.Root<X> from(Class<X> entityClass)
from in interface javax.persistence.criteria.AbstractQuery<T>public <X> javax.persistence.criteria.Root<X> from(javax.persistence.metamodel.EntityType<X> entity)
from in interface javax.persistence.criteria.AbstractQuery<T>public String generateJpql()
generateJpql in interface BaseQuery<T>public String generateJpqlRestriction(BaseQueryImpl<?> query)
generateJpqlRestriction in class AbstractExpression<T>query - the querypublic String generateJpqlSelect(AbstractCriteriaQueryImpl<?> query, boolean selected)
generateJpqlSelect in class AbstractSelection<T>query - the criteria queryselected - if the selection is selectedpublic String generateSql()
generateSql in interface BaseQuery<T>public String generateSqlSelect(AbstractCriteriaQueryImpl<?> query, boolean selected)
generateSqlSelect in class AbstractSelection<T>query - the queryselected - if the selection is selectedpublic String generateTableAlias(boolean entity)
generateTableAlias in interface BaseQuery<T>entity - true if the table is an entity table, false for element collectionspublic Integer getAlias(AbstractParameterExpressionImpl<?> parameter)
public String getAlias(AbstractSelection<?> selection)
public Set<javax.persistence.criteria.Join<?,?>> getCorrelatedJoins()
getCorrelatedJoins in interface javax.persistence.criteria.Subquery<T>public String getFieldAlias(String tableAlias, AbstractColumn column)
getFieldAlias in interface BaseQuery<T>tableAlias - the alias of the tablecolumn - the columnpublic List<javax.persistence.criteria.Expression<?>> getGroupList()
getGroupList in interface javax.persistence.criteria.AbstractQuery<T>public javax.persistence.criteria.Predicate getGroupRestriction()
getGroupRestriction in interface javax.persistence.criteria.AbstractQuery<T>public JdbcAdaptor getJdbcAdaptor()
getJdbcAdaptor in interface BaseQuery<T>public String getJpql()
public MetamodelImpl getMetamodel()
getMetamodel in interface BaseQuery<T>public AbstractParameterExpressionImpl<?> getParameter(int position)
getParameter in interface BaseQuery<T>position - the positionpublic Set<javax.persistence.criteria.ParameterExpression<?>> getParameters()
Modifications to the set do not affect the query.
getParameters in interface BaseQuery<T>public javax.persistence.criteria.AbstractQuery<?> getParent()
getParent in interface javax.persistence.criteria.Subquery<T>public javax.persistence.criteria.Predicate getRestriction()
getRestriction in interface javax.persistence.criteria.AbstractQuery<T>public Class<T> getResultType()
getResultType in interface javax.persistence.criteria.AbstractQuery<T>public Set<javax.persistence.criteria.Root<?>> getRoots()
getRoots in interface javax.persistence.criteria.AbstractQuery<T>public javax.persistence.criteria.Expression<T> getSelection()
public String getSql()
public List<AbstractParameterExpressionImpl<?>> getSqlParameters()
getSqlParameters in interface BaseQuery<T>public String[] getSqlRestrictionFragments(BaseQueryImpl<?> query)
getSqlRestrictionFragments in class AbstractSelection<T>query - the querypublic SubqueryImpl<T> groupBy(javax.persistence.criteria.Expression<?>... grouping)
public SubqueryImpl<T> groupBy(List<javax.persistence.criteria.Expression<?>> grouping)
public T handle(QueryImpl<?> query, SessionImpl session, ResultSet row) throws SQLException
handle in class AbstractSelection<T>query - the querysession - the sessionrow - the rowSQLException - thrown in case of an underlying SQL Errorpublic SubqueryImpl<T> having(javax.persistence.criteria.Expression<Boolean> restriction)
public SubqueryImpl<T> having(javax.persistence.criteria.Predicate... restrictions)
public boolean isDistinct()
isDistinct in interface javax.persistence.criteria.AbstractQuery<T>public javax.persistence.criteria.Subquery<T> select(javax.persistence.criteria.Expression<T> expression)
select in interface javax.persistence.criteria.Subquery<T>public int setNextSqlParam(AbstractParameterExpressionImpl<?> parameter)
setNextSqlParam in interface BaseQuery<T>parameter - the parameter to addpublic <U> SubqueryImpl<U> subquery(Class<U> type)
public javax.persistence.criteria.Subquery<T> where(javax.persistence.criteria.Expression<Boolean> restriction)
Copyright © 2012 Batoo Software & Consultancy. All Rights Reserved.