类 CriteriaImpl.Subcriteria
- java.lang.Object
-
- org.hibernate.internal.CriteriaImpl.Subcriteria
-
- 所有已实现的接口:
Serializable,Criteria,CriteriaSpecification
- 封闭类:
- CriteriaImpl
public final class CriteriaImpl.Subcriteria extends Object implements Criteria, Serializable
- 另请参阅:
- 序列化表格
-
-
字段概要
-
从接口继承的字段 org.hibernate.criterion.CriteriaSpecification
ALIAS_TO_ENTITY_MAP, DISTINCT_ROOT_ENTITY, FULL_JOIN, INNER_JOIN, LEFT_JOIN, PROJECTION, ROOT_ALIAS, ROOT_ENTITY
-
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Criteriaadd(Criterion expression)Add arestrictionto constrain the results to be retrieved.CriteriaaddOrder(Order order)Add anorderingto the result set.CriteriaaddQueryHint(String queryHint)Add a DB query hint to the SQL.CriteriacreateAlias(String associationPath, String alias)Join an association, assigning an alias to the joined association.CriteriacreateAlias(String associationPath, String alias, int joinType)Join an association using the specified join-type, assigning an alias to the joined association.CriteriacreateAlias(String associationPath, String alias, int joinType, Criterion withClause)Join an association using the specified join-type, assigning an alias to the joined association.CriteriacreateAlias(String associationPath, String alias, JoinType joinType)Join an association using the specified join-type, assigning an alias to the joined association.CriteriacreateAlias(String associationPath, String alias, JoinType joinType, Criterion withClause)Join an association using the specified join-type, assigning an alias to the joined association.CriteriacreateCriteria(String associationPath)Create a new Criteria, "rooted" at the associated entity.CriteriacreateCriteria(String associationPath, int joinType)Create a new Criteria, "rooted" at the associated entity, using the specified join type.CriteriacreateCriteria(String associationPath, String alias)Create a new Criteria, "rooted" at the associated entity, assigning the given alias.CriteriacreateCriteria(String associationPath, String alias, int joinType)Create a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.CriteriacreateCriteria(String associationPath, String alias, int joinType, Criterion withClause)Create a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.CriteriacreateCriteria(String associationPath, String alias, JoinType joinType)Create a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.CriteriacreateCriteria(String associationPath, String alias, JoinType joinType, Criterion withClause)Create a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.CriteriacreateCriteria(String associationPath, JoinType joinType)Create a new Criteria, "rooted" at the associated entity, using the specified join type.StringgetAlias()Get the alias of the entity encapsulated by this criteria instance.JoinTypegetJoinType()LockModegetLockMode()CriteriagetParent()StringgetPath()CriteriongetWithClause()booleanhasRestriction()booleanisReadOnly()Should entities and proxies loaded by this Criteria be put in read-only mode?booleanisReadOnlyInitialized()Was the read-only/modifiable mode explicitly initialized?Listlist()Get the results.ScrollableResultsscroll()Get the results as an instance ofScrollableResults.ScrollableResultsscroll(ScrollMode scrollMode)Get the results as an instance ofScrollableResultsbased on the given scroll mode.voidsetAlias(String alias)CriteriasetCacheable(boolean cacheable)Enable caching of this query result, provided query caching is enabled for the underlying session factory.CriteriasetCacheMode(CacheMode cacheMode)Override the cache mode for this particular query.CriteriasetCacheRegion(String cacheRegion)Set the name of the cache region to use for query result caching.CriteriasetComment(String comment)Add a comment to the generated SQL.CriteriasetFetchMode(String associationPath, FetchMode mode)Specify an association fetching strategy for an association or a collection of values.CriteriasetFetchSize(int fetchSize)Set a fetch size for the underlying JDBC query.CriteriasetFirstResult(int firstResult)Set the first result to be retrieved.CriteriasetFlushMode(FlushMode flushMode)Override the flush mode for this particular query.CriteriasetLockMode(String alias, LockMode lockMode)Set the lock mode of the aliased entity.CriteriasetLockMode(LockMode lockMode)Set the lock mode of the current entity.CriteriasetMaxResults(int maxResults)Set a limit upon the number of objects to be retrieved.CriteriasetProjection(Projection projection)Used to specify that the query results will be a projection (scalar in nature).CriteriasetReadOnly(boolean readOnly)Set the read-only/modifiable mode for entities and proxies loaded by this Criteria.CriteriasetResultTransformer(ResultTransformer resultProcessor)Set a strategy for handling the query results.CriteriasetTimeout(int timeout)Set a timeout for the underlying JDBC query.StringtoString()ObjectuniqueResult()Convenience method to return a single instance that matches the query, or null if the query returns no results.
-
-
-
方法详细资料
-
getAlias
public String getAlias()
从接口复制的说明:CriteriaGet the alias of the entity encapsulated by this criteria instance.
-
setAlias
public void setAlias(String alias)
-
getPath
public String getPath()
-
getParent
public Criteria getParent()
-
getLockMode
public LockMode getLockMode()
-
setLockMode
public Criteria setLockMode(LockMode lockMode)
从接口复制的说明:CriteriaSet the lock mode of the current entity.- 指定者:
setLockMode在接口中Criteria- 参数:
lockMode- The lock mode to be applied- 返回:
- this (for method chaining)
-
getJoinType
public JoinType getJoinType()
-
getWithClause
public Criterion getWithClause()
-
hasRestriction
public boolean hasRestriction()
-
add
public Criteria add(Criterion expression)
从接口复制的说明:CriteriaAdd arestrictionto constrain the results to be retrieved.
-
addOrder
public Criteria addOrder(Order order)
从接口复制的说明:CriteriaAdd anorderingto the result set.
-
createAlias
public Criteria createAlias(String associationPath, String alias)
从接口复制的说明:CriteriaJoin an association, assigning an alias to the joined association. Functionally equivalent toCriteria.createAlias(String, String, JoinType )usingJoinType.INNER_JOINfor the joinType.- 指定者:
createAlias在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).- 返回:
- this (for method chaining)
-
createAlias
public Criteria createAlias(String associationPath, String alias, JoinType joinType) throws HibernateException
从接口复制的说明:CriteriaJoin an association using the specified join-type, assigning an alias to the joined association. The joinType is expected to be one ofJoinType.INNER_JOIN(the default),JoinType.FULL_JOIN, orJoinType.LEFT_OUTER_JOIN.- 指定者:
createAlias在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).joinType- The type of join to use.- 返回:
- this (for method chaining)
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
createAlias
public Criteria createAlias(String associationPath, String alias, int joinType) throws HibernateException
从接口复制的说明:CriteriaJoin an association using the specified join-type, assigning an alias to the joined association. The joinType is expected to be one ofCriteriaSpecification.INNER_JOIN(the default),CriteriaSpecification.FULL_JOIN, orCriteriaSpecification.LEFT_JOIN.- 指定者:
createAlias在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).joinType- The type of join to use.- 返回:
- this (for method chaining)
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
createAlias
public Criteria createAlias(String associationPath, String alias, JoinType joinType, Criterion withClause) throws HibernateException
从接口复制的说明:CriteriaJoin an association using the specified join-type, assigning an alias to the joined association. The joinType is expected to be one ofJoinType.INNER_JOIN(the default),JoinType.FULL_JOIN, orJoinType.LEFT_OUTER_JOIN.- 指定者:
createAlias在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).joinType- The type of join to use.withClause- The criteria to be added to the join condition (ON clause)- 返回:
- this (for method chaining)
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
createAlias
public Criteria createAlias(String associationPath, String alias, int joinType, Criterion withClause) throws HibernateException
从接口复制的说明:CriteriaJoin an association using the specified join-type, assigning an alias to the joined association. The joinType is expected to be one ofCriteriaSpecification.INNER_JOIN(the default),CriteriaSpecification.FULL_JOIN, orCriteriaSpecification.LEFT_JOIN.- 指定者:
createAlias在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).joinType- The type of join to use.withClause- The criteria to be added to the join condition (ON clause)- 返回:
- this (for method chaining)
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
createCriteria
public Criteria createCriteria(String associationPath)
从接口复制的说明:CriteriaCreate a new Criteria, "rooted" at the associated entity. Functionally equivalent toCriteria.createCriteria(String, org.hibernate.sql.JoinType)usingJoinType.INNER_JOINfor the joinType.- 指定者:
createCriteria在接口中Criteria- 参数:
associationPath- A dot-separated property path- 返回:
- the created "sub criteria"
-
createCriteria
public Criteria createCriteria(String associationPath, JoinType joinType) throws HibernateException
从接口复制的说明:CriteriaCreate a new Criteria, "rooted" at the associated entity, using the specified join type.- 指定者:
createCriteria在接口中Criteria- 参数:
associationPath- A dot-separated property pathjoinType- The type of join to use.- 返回:
- the created "sub criteria"
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
createCriteria
public Criteria createCriteria(String associationPath, int joinType) throws HibernateException
从接口复制的说明:CriteriaCreate a new Criteria, "rooted" at the associated entity, using the specified join type.- 指定者:
createCriteria在接口中Criteria- 参数:
associationPath- A dot-separated property pathjoinType- The type of join to use.- 返回:
- the created "sub criteria"
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
createCriteria
public Criteria createCriteria(String associationPath, String alias)
从接口复制的说明:CriteriaCreate a new Criteria, "rooted" at the associated entity, assigning the given alias. Functionally equivalent toCriteria.createCriteria(String, String, org.hibernate.sql.JoinType)usingJoinType.INNER_JOINfor the joinType.- 指定者:
createCriteria在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).- 返回:
- the created "sub criteria"
-
createCriteria
public Criteria createCriteria(String associationPath, String alias, JoinType joinType) throws HibernateException
从接口复制的说明:CriteriaCreate a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.- 指定者:
createCriteria在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).joinType- The type of join to use.- 返回:
- the created "sub criteria"
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
createCriteria
public Criteria createCriteria(String associationPath, String alias, int joinType) throws HibernateException
从接口复制的说明:CriteriaCreate a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.- 指定者:
createCriteria在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).joinType- The type of join to use.- 返回:
- the created "sub criteria"
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
createCriteria
public Criteria createCriteria(String associationPath, String alias, JoinType joinType, Criterion withClause) throws HibernateException
从接口复制的说明:CriteriaCreate a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.- 指定者:
createCriteria在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).joinType- The type of join to use.withClause- The criteria to be added to the join condition (ON clause)- 返回:
- the created "sub criteria"
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
createCriteria
public Criteria createCriteria(String associationPath, String alias, int joinType, Criterion withClause) throws HibernateException
从接口复制的说明:CriteriaCreate a new Criteria, "rooted" at the associated entity, assigning the given alias and using the specified join type.- 指定者:
createCriteria在接口中Criteria- 参数:
associationPath- A dot-separated property pathalias- The alias to assign to the joined association (for later reference).joinType- The type of join to use.withClause- The criteria to be added to the join condition (ON clause)- 返回:
- the created "sub criteria"
- 抛出:
HibernateException- Indicates a problem creating the sub criteria
-
isReadOnly
public boolean isReadOnly()
从接口复制的说明:CriteriaShould entities and proxies loaded by this Criteria be put in read-only mode? If the read-only/modifiable setting was not initialized, then the default read-only/modifiable setting for the persistence context is returned instead.- 指定者:
isReadOnly在接口中Criteria- 返回:
- true, entities and proxies loaded by the criteria will be put in read-only mode false, entities and proxies loaded by the criteria will be put in modifiable mode
- 另请参阅:
Criteria.setReadOnly(boolean),The read-only/modifiable setting has no impact on entities/proxies returned by the Criteria that existed in the session before the Criteria was executed.,Criteria.isReadOnlyInitialized()
-
isReadOnlyInitialized
public boolean isReadOnlyInitialized()
从接口复制的说明:CriteriaWas the read-only/modifiable mode explicitly initialized?- 指定者:
isReadOnlyInitialized在接口中Criteria- 返回:
- true, the read-only/modifiable mode was explicitly initialized; false, otherwise.
- 另请参阅:
Criteria.setReadOnly(boolean)
-
setReadOnly
public Criteria setReadOnly(boolean readOnly)
从接口复制的说明:CriteriaSet the read-only/modifiable mode for entities and proxies loaded by this Criteria. This setting overrides the default setting for the persistence context.- 指定者:
setReadOnly在接口中Criteria- 参数:
readOnly- true, entities and proxies loaded by the criteria will be put in read-only mode false, entities and proxies loaded by the criteria will be put in modifiable mode- 返回:
this, for method chaining- 另请参阅:
To set the default read-only/modifiable setting used for entities and proxies that are loaded into the session:,PersistenceContext.setDefaultReadOnly(boolean),Read-only entities are not dirty-checked and snapshots of persistent state are not maintained. Read-only entities can be modified, but changes are not persisted. When a proxy is initialized, the loaded entity will have the same read-only/modifiable setting as the uninitialized proxy has, regardless of the session's current setting. The read-only/modifiable setting has no impact on entities/proxies returned by the criteria that existed in the session before the criteria was executed.
-
setCacheable
public Criteria setCacheable(boolean cacheable)
从接口复制的说明:CriteriaEnable caching of this query result, provided query caching is enabled for the underlying session factory.- 指定者:
setCacheable在接口中Criteria- 参数:
cacheable- Should the result be considered cacheable; default is to not cache (false).- 返回:
- this (for method chaining)
-
setCacheRegion
public Criteria setCacheRegion(String cacheRegion)
从接口复制的说明:CriteriaSet the name of the cache region to use for query result caching.- 指定者:
setCacheRegion在接口中Criteria- 参数:
cacheRegion- the name of a query cache region, or null for the default query cache- 返回:
- this (for method chaining)
- 另请参阅:
Criteria.setCacheable(boolean)
-
list
public List list() throws HibernateException
从接口复制的说明:CriteriaGet the results.- 指定者:
list在接口中Criteria- 返回:
- The list of matched query results.
- 抛出:
HibernateException- Indicates a problem either translating the criteria to SQL, exeucting the SQL or processing the SQL results.
-
scroll
public ScrollableResults scroll() throws HibernateException
从接口复制的说明:CriteriaGet the results as an instance ofScrollableResults.- 指定者:
scroll在接口中Criteria- 返回:
- The
ScrollableResultsrepresenting the matched query results. - 抛出:
HibernateException- Indicates a problem either translating the criteria to SQL, exeucting the SQL or processing the SQL results.
-
scroll
public ScrollableResults scroll(ScrollMode scrollMode) throws HibernateException
从接口复制的说明:CriteriaGet the results as an instance ofScrollableResultsbased on the given scroll mode.- 指定者:
scroll在接口中Criteria- 参数:
scrollMode- Indicates the type of underlying database cursor to request.- 返回:
- The
ScrollableResultsrepresenting the matched query results. - 抛出:
HibernateException- Indicates a problem either translating the criteria to SQL, executing the SQL or processing the SQL results.
-
uniqueResult
public Object uniqueResult() throws HibernateException
从接口复制的说明:CriteriaConvenience method to return a single instance that matches the query, or null if the query returns no results.- 指定者:
uniqueResult在接口中Criteria- 返回:
- the single result or null
- 抛出:
HibernateException- if there is more than one matching result
-
setFetchMode
public Criteria setFetchMode(String associationPath, FetchMode mode)
从接口复制的说明:CriteriaSpecify an association fetching strategy for an association or a collection of values.- 指定者:
setFetchMode在接口中Criteria- 参数:
associationPath- a dot separated property pathmode- The fetch mode for the referenced association- 返回:
- this (for method chaining)
-
setFlushMode
public Criteria setFlushMode(FlushMode flushMode)
从接口复制的说明:CriteriaOverride the flush mode for this particular query.- 指定者:
setFlushMode在接口中Criteria- 参数:
flushMode- The flush mode to use.- 返回:
- this (for method chaining)
-
setCacheMode
public Criteria setCacheMode(CacheMode cacheMode)
从接口复制的说明:CriteriaOverride the cache mode for this particular query.- 指定者:
setCacheMode在接口中Criteria- 参数:
cacheMode- The cache mode to use.- 返回:
- this (for method chaining)
-
setFirstResult
public Criteria setFirstResult(int firstResult)
从接口复制的说明:CriteriaSet the first result to be retrieved.- 指定者:
setFirstResult在接口中Criteria- 参数:
firstResult- the first result to retrieve, numbered from 0- 返回:
- this (for method chaining)
-
setMaxResults
public Criteria setMaxResults(int maxResults)
从接口复制的说明:CriteriaSet a limit upon the number of objects to be retrieved.- 指定者:
setMaxResults在接口中Criteria- 参数:
maxResults- the maximum number of results- 返回:
- this (for method chaining)
-
setTimeout
public Criteria setTimeout(int timeout)
从接口复制的说明:CriteriaSet a timeout for the underlying JDBC query.- 指定者:
setTimeout在接口中Criteria- 参数:
timeout- The timeout value to apply.- 返回:
- this (for method chaining)
- 另请参阅:
Statement.setQueryTimeout(int)
-
setFetchSize
public Criteria setFetchSize(int fetchSize)
从接口复制的说明:CriteriaSet a fetch size for the underlying JDBC query.- 指定者:
setFetchSize在接口中Criteria- 参数:
fetchSize- the fetch size- 返回:
- this (for method chaining)
- 另请参阅:
Statement.setFetchSize(int)
-
setLockMode
public Criteria setLockMode(String alias, LockMode lockMode)
从接口复制的说明:CriteriaSet the lock mode of the aliased entity.- 指定者:
setLockMode在接口中Criteria- 参数:
alias- The previously assigned alias representing the entity to which the given lock mode should apply.lockMode- The lock mode to be applied- 返回:
- this (for method chaining)
-
setResultTransformer
public Criteria setResultTransformer(ResultTransformer resultProcessor)
从接口复制的说明:CriteriaSet a strategy for handling the query results. This determines the "shape" of the query result.- 指定者:
setResultTransformer在接口中Criteria- 参数:
resultProcessor- The transformer to apply- 返回:
- this (for method chaining)
- 另请参阅:
CriteriaSpecification.ROOT_ENTITY,CriteriaSpecification.DISTINCT_ROOT_ENTITY,CriteriaSpecification.ALIAS_TO_ENTITY_MAP,CriteriaSpecification.PROJECTION
-
setComment
public Criteria setComment(String comment)
从接口复制的说明:CriteriaAdd a comment to the generated SQL.- 指定者:
setComment在接口中Criteria- 参数:
comment- a human-readable string- 返回:
- this (for method chaining)
-
addQueryHint
public Criteria addQueryHint(String queryHint)
从接口复制的说明:CriteriaAdd a DB query hint to the SQL. These differ from JPA'sQueryHint, which is specific to the JPA implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the vendor-specific hints, such as Oracle's optimizers. Multiple query hints are supported; the Dialect will determine concatenation and placement.- 指定者:
addQueryHint在接口中Criteria- 参数:
queryHint- The database specific query hint to add.- 返回:
- this (for method chaining)
-
setProjection
public Criteria setProjection(Projection projection)
从接口复制的说明:CriteriaUsed to specify that the query results will be a projection (scalar in nature). Implicitly specifies theCriteriaSpecification.PROJECTIONresult transformer. The individual components contained within the givenprojectiondetermines the overall "shape" of the query result.- 指定者:
setProjection在接口中Criteria- 参数:
projection- The projection representing the overall "shape" of the query results.- 返回:
- this (for method chaining)
-
-