/** * Apply a "maximalize" constraint, with the ability to specify further constraints on the maximized * property */ public AggregatedAuditExpression maximize() { return new AggregatedAuditExpression( alias, propertyNameGetter, AggregatedAuditExpression.AggregatedMode.MAX ); }
/** * Apply a "greater than or equal" constraint to another property */ public AuditCriterion geProperty(String otherPropertyName) { /* * We provide alias as otherAlias rather than null, because this seems the intuitive use case. * E.g. if the user calls AuditEntity.property( "alias", "prop" ).geProperty( "otherProp" ) * it is assumed that the otherProp is on the same entity as prop and therefore we have to use * the same alias. */ return geProperty( alias, otherPropertyName ); }
/** * Apply a "less than or equal" constraint to another property */ public AuditCriterion leProperty(String otherPropertyName) { /* * We provide alias as otherAlias rather than null, because this seems the intuitive use case. * E.g. if the user calls AuditEntity.property( "alias", "prop" ).leProperty( "otherProp" ) * it is assumed that the otherProp is on the same entity as prop and therefore we have to use * the same alias. */ return leProperty( alias, otherPropertyName ); }
/** * Apply an "equal" constraint to another property */ public AuditCriterion eqProperty(String otherPropertyName) { /* * We provide alias as otherAlias rather than null, because this seems the intuitive use case. * E.g. if the user calls AuditEntity.property( "alias", "prop" ).eqProperty( "otherProp" ) * it is assumed that the otherProp is on the same entity as prop and therefore we have to use * the same alias. */ return eqProperty( alias, otherPropertyName ); }
/** * Apply a "like" constraint */ public AuditCriterion like(String value, MatchMode matchMode) { return new SimpleAuditExpression( alias, propertyNameGetter, matchMode.toMatchString( value ), " like " ); }
/** * Apply on "ilike" constraint */ public AuditCriterion ilike(String value, MatchMode matchMode) { return new IlikeAuditExpression( alias, propertyNameGetter, matchMode.toMatchString( value ) ); }
/** * Create restrictions, projections and specify order for a property of an audited entity. * * @param alias the alias of the entity which owns the property. * @param propertyName Name of the property. */ public static AuditProperty<Object> property(String alias, String propertyName) { return new AuditProperty<>( alias, new EntityPropertyName( propertyName ) ); }
public void addToQuery( EnversService enversService, AuditReaderImplementor versionsReader, Map<String, String> aliasToEntityNameMap, String alias, QueryBuilder qb, Parameters parameters) { criterion.addToQuery( enversService, versionsReader, aliasToEntityNameMap, alias, qb, parameters.addNegatedParameters() ); } }
/** * Apply a "greater than" constraint to another property */ public AuditCriterion gtProperty(String otherPropertyName) { /* * We provide alias as otherAlias rather than null, because this seems the intuitive use case. * E.g. if the user calls AuditEntity.property( "alias", "prop" ).gtProperty( "otherProp" ) * it is assumed that the otherProp is on the same entity as prop and therefore we have to use * the same alias. */ return gtProperty( alias, otherPropertyName ); }
/** * Group criterions together in a single conjunction (A and B and C...). */ public static AuditConjunction conjunction() { return new AuditConjunction(); }
/** * Group criterions together in a single disjunction (A or B or C...). */ public static AuditDisjunction disjunction() { return new AuditDisjunction(); }
/** * Apply a "not equal" constraint to another property */ public AuditCriterion neProperty(String otherPropertyName) { /* * We provide alias as otherAlias rather than null, because this seems the intuitive use case. * E.g. if the user calls AuditEntity.property( "alias", "prop" ).neProperty( "otherProp" ) * it is assumed that the otherProp is on the same entity as prop and therefore we have to use * the same alias. */ return neProperty( alias, otherPropertyName ); }
/** * Apply a "less than" constraint to another property */ public AuditCriterion ltProperty(String otherPropertyName) { /* * We provide alias as otherAlias rather than null, because this seems the intuitive use case. * E.g. if the user calls AuditEntity.property( "alias", "prop" ).ltProperty( "otherProp" ) * it is assumed that the otherProp is on the same entity as prop and therefore we have to use * the same alias. */ return ltProperty( alias, otherPropertyName ); }
public static AuditId id(String alias) { return new AuditId( alias ); }
/** * Create restrictions on an id of a related entity. * * @param alias the alias of the entity which owns the relation property. * @param propertyName Name of the property, which is the relation. */ public static AuditRelatedId relatedId(String alias, String propertyName) { return new AuditRelatedId( alias, new EntityPropertyName( propertyName ) ); }
/** * Create restrictions, projections and specify order for a property of the revision entity, * corresponding to an audited entity. * * @param alias the alias of the entity which owns the revision property. * @param propertyName Name of the property. */ public static AuditProperty<Object> revisionProperty(String alias, String propertyName) { return new AuditProperty<>( alias, new RevisionPropertyPropertyName( propertyName ) ); }
/** * Apply a "minimize" constraint, with the ability to specify further constraints on the minimized * property */ public AggregatedAuditExpression minimize() { return new AggregatedAuditExpression( alias, propertyNameGetter, AggregatedAuditExpression.AggregatedMode.MIN ); }
public void addToQuery( EnversService enversService, AuditReaderImplementor versionsReader, Map<String, String> aliasToEntityNameMap, String alias, QueryBuilder qb, Parameters parameters) { Parameters opParameters = parameters.addSubParameters( op ); lhs.addToQuery( enversService, versionsReader, aliasToEntityNameMap, alias, qb, opParameters.addSubParameters( "and" ) ); rhs.addToQuery( enversService, versionsReader, aliasToEntityNameMap, alias, qb, opParameters.addSubParameters( "and" ) ); } }
/** * Create restrictions, projections and specify order for the revision type, corresponding to an * audited entity. * * @param alias the alias of the entity which owns the revision type. */ public static AuditProperty<RevisionType> revisionType(String alias) { return new AuditProperty<>( alias, new RevisionTypePropertyName() ); }
/** * Create restrictions, projections and specify order for the revision number, corresponding to an * audited entity. * * @param alias the alias of the entity which owns the revision number. */ public static AuditProperty<Number> revisionNumber(String alias) { return new AuditProperty<>( alias, new RevisionNumberPropertyName() ); }