org.hibernate.envers.query.impl
Class AbstractAuditQuery

java.lang.Object
  extended by org.hibernate.envers.query.impl.AbstractAuditQuery
All Implemented Interfaces:
AuditQuery
Direct Known Subclasses:
EntitiesAtRevisionQuery, EntitiesModifiedAtRevisionQuery, RevisionsOfEntityQuery

public abstract class AbstractAuditQuery
extends Object
implements AuditQuery


Field Summary
protected  List<AuditCriterion> criterions
           
protected  String entityClassName
           
protected  EntityInstantiator entityInstantiator
           
protected  String entityName
           
protected  boolean hasOrder
           
protected  boolean hasProjection
           
protected  QueryBuilder qb
           
protected  AuditConfiguration verCfg
           
protected  String versionsEntityName
           
 
Constructor Summary
protected AbstractAuditQuery(AuditConfiguration verCfg, AuditReaderImplementor versionsReader, Class<?> cls)
           
protected AbstractAuditQuery(AuditConfiguration verCfg, AuditReaderImplementor versionsReader, Class<?> cls, String entityName)
           
 
Method Summary
 AuditQuery add(AuditCriterion criterion)
           
 AuditQuery addOrder(AuditOrder order)
           
 AuditQuery addProjection(AuditProjection projection)
           
protected  List buildAndExecuteQuery()
           
protected  Query buildQuery()
           
 List getResultList()
           
 Object getSingleResult()
           
abstract  List list()
           
 AuditQuery setCacheable(boolean cacheable)
           
 AuditQuery setCacheMode(CacheMode cacheMode)
           
 AuditQuery setCacheRegion(String cacheRegion)
           
 AuditQuery setComment(String comment)
           
 AuditQuery setFirstResult(int firstResult)
           
 AuditQuery setFlushMode(FlushMode flushMode)
           
 AuditQuery setLockMode(LockMode lockMode)
          Deprecated. Instead use setLockOptions
 AuditQuery setLockOptions(LockOptions lockOptions)
          Set lock options
 AuditQuery setMaxResults(int maxResults)
           
protected  void setQueryProperties(Query query)
           
 AuditQuery setTimeout(int timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityInstantiator

protected EntityInstantiator entityInstantiator

criterions

protected List<AuditCriterion> criterions

entityName

protected String entityName

entityClassName

protected String entityClassName

versionsEntityName

protected String versionsEntityName

qb

protected QueryBuilder qb

hasProjection

protected boolean hasProjection

hasOrder

protected boolean hasOrder

verCfg

protected final AuditConfiguration verCfg
Constructor Detail

AbstractAuditQuery

protected AbstractAuditQuery(AuditConfiguration verCfg,
                             AuditReaderImplementor versionsReader,
                             Class<?> cls)

AbstractAuditQuery

protected AbstractAuditQuery(AuditConfiguration verCfg,
                             AuditReaderImplementor versionsReader,
                             Class<?> cls,
                             String entityName)
Method Detail

buildQuery

protected Query buildQuery()

buildAndExecuteQuery

protected List buildAndExecuteQuery()

list

public abstract List list()
                   throws AuditException
Throws:
AuditException

getResultList

public List getResultList()
                   throws AuditException
Specified by:
getResultList in interface AuditQuery
Throws:
AuditException

getSingleResult

public Object getSingleResult()
                       throws AuditException,
                              NonUniqueResultException,
                              NoResultException
Specified by:
getSingleResult in interface AuditQuery
Throws:
AuditException
NonUniqueResultException
NoResultException

add

public AuditQuery add(AuditCriterion criterion)
Specified by:
add in interface AuditQuery

addProjection

public AuditQuery addProjection(AuditProjection projection)
Specified by:
addProjection in interface AuditQuery

addOrder

public AuditQuery addOrder(AuditOrder order)
Specified by:
addOrder in interface AuditQuery

setMaxResults

public AuditQuery setMaxResults(int maxResults)
Specified by:
setMaxResults in interface AuditQuery

setFirstResult

public AuditQuery setFirstResult(int firstResult)
Specified by:
setFirstResult in interface AuditQuery

setCacheable

public AuditQuery setCacheable(boolean cacheable)
Specified by:
setCacheable in interface AuditQuery

setCacheRegion

public AuditQuery setCacheRegion(String cacheRegion)
Specified by:
setCacheRegion in interface AuditQuery

setComment

public AuditQuery setComment(String comment)
Specified by:
setComment in interface AuditQuery

setFlushMode

public AuditQuery setFlushMode(FlushMode flushMode)
Specified by:
setFlushMode in interface AuditQuery

setCacheMode

public AuditQuery setCacheMode(CacheMode cacheMode)
Specified by:
setCacheMode in interface AuditQuery

setTimeout

public AuditQuery setTimeout(int timeout)
Specified by:
setTimeout in interface AuditQuery

setLockMode

public AuditQuery setLockMode(LockMode lockMode)
Deprecated. Instead use setLockOptions

Set lock mode

Specified by:
setLockMode in interface AuditQuery
Parameters:
lockMode - The LockMode used for this query.
Returns:
this object

setLockOptions

public AuditQuery setLockOptions(LockOptions lockOptions)
Set lock options

Parameters:
lockOptions - The @{link LockOptions} used for this query.
Returns:
this object

setQueryProperties

protected void setQueryProperties(Query query)


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.