Class AbstractRelationQueryGenerator
java.lang.Object
org.hibernate.envers.internal.entities.mapper.relation.query.AbstractRelationQueryGenerator
- All Implemented Interfaces:
RelationQueryGenerator
- Direct Known Subclasses:
OneAuditEntityQueryGenerator
,OneEntityQueryGenerator
,ThreeEntityQueryGenerator
,TwoEntityOneAuditedQueryGenerator
,TwoEntityQueryGenerator
public abstract class AbstractRelationQueryGenerator
extends Object
implements RelationQueryGenerator
Base class for implementers of
RelationQueryGenerator
contract.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AuditStrategy
protected final Configuration
protected final String
protected final String
protected final MiddleIdData
protected final boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractRelationQueryGenerator
(Configuration configuration, String entityName, MiddleIdData referencingIdData, boolean revisionTypeInId, String orderByCollectionRole) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Apply predicates to fetch data and deletions that took place during the same revision.protected abstract void
applyValidPredicates
(QueryBuilder qb, Parameters parameters, boolean inclusive) Apply predicates used to fetch actual data.protected abstract QueryBuilder
buildQueryBuilderCommon
(SessionFactoryImplementor sessionFactory) Build the common aspects of aQueryBuilder
used by both query and query-remove strings.getQuery
(SharedSessionContractImplementor session, Object primaryKey, Number revision, boolean removed) Return the query to fetch the relation.protected String
-
Field Details
-
configuration
-
auditStrategy
-
referencingIdData
-
revisionTypeInId
protected final boolean revisionTypeInId -
entityName
-
orderByCollectionRole
-
-
Constructor Details
-
AbstractRelationQueryGenerator
protected AbstractRelationQueryGenerator(Configuration configuration, String entityName, MiddleIdData referencingIdData, boolean revisionTypeInId, String orderByCollectionRole)
-
-
Method Details
-
buildQueryBuilderCommon
Build the common aspects of aQueryBuilder
used by both query and query-remove strings.- Parameters:
sessionFactory
- The session factory.- Returns:
- The constructed query builder instance.
-
applyValidPredicates
protected abstract void applyValidPredicates(QueryBuilder qb, Parameters parameters, boolean inclusive) Apply predicates used to fetch actual data.- Parameters:
qb
- The query builder instance to apply predicates against.parameters
- The root query parametersinclusive
- Whether its inclusive or not.
-
applyValidAndRemovePredicates
Apply predicates to fetch data and deletions that took place during the same revision.- Parameters:
qb
- The query builder instance to apply predicates against.
-
getRevisionTypePath