private DetachedCriteria buildModificationDetachedQuery(List<Criterion> criteria) { DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Modification.class); Disjunction disjunction = Restrictions.disjunction(); detachedCriteria.add(disjunction); for (Criterion criterion : criteria) { disjunction.add(criterion); } detachedCriteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return detachedCriteria; }
private DetachedCriteria buildPMRDetachedQuery(List<Long> pipelineIds) { DetachedCriteria criteria = DetachedCriteria.forClass(PipelineMaterialRevision.class); criteria.add(Restrictions.in("pipelineId", pipelineIds)); criteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return criteria; }
/** * Creates an equality restriction. * * @param value The value to check against * * @return The equality restriction. * * @see Restrictions#eq(String, Object) */ public SimpleExpression eq(Object value) { return Restrictions.eq( getPropertyName(), value ); }
/** * Set a natural identifier value for this expression * * @param property The specific property name * @param value The value to use * * @return {@code this}, for method chaining */ public NaturalIdentifier set(String property, Object value) { conjunction.add( Restrictions.eq( property, value ) ); return this; }
/** * Creates a NULL restriction * * @return The restriction * * @see Restrictions#isNull(String) */ public Criterion isNull() { return Restrictions.isNull( getPropertyName() ); }
/** * Creates a LIKE restriction for this property * * @param value The value to like compare with * * @return The LIKE restriction * * @see Restrictions#like(String, Object) */ public SimpleExpression like(Object value) { return Restrictions.like( getPropertyName(), value ); }
/** * Create a less-than restriction based on this property * * @param value The value to check against * * @return The less-than restriction * * @see Restrictions#lt(String, Object) */ public SimpleExpression lt(Object value) { return Restrictions.lt( getPropertyName(), value ); }
/** * Creates a NOT NULL restriction * * @return The restriction * * @see Restrictions#isNotNull(String) */ public Criterion isNotNull() { return Restrictions.isNotNull( getPropertyName() ); }
/** * Creates a non-equality restriction. * * @param value The value to check against * * @return The non-equality restriction. * * @see Restrictions#ne(String, Object) */ public SimpleExpression ne(Object value) { return Restrictions.ne( getPropertyName(), value ); }
/** * Creates a property count projection * * @return The projection * * @see Projections#count */ public CountProjection count() { return Projections.count( getPropertyName() ); }
/** * Creates a restriction to check that a collection is empty * * @return The restriction * * @see Restrictions#isEmpty(String) */ public Criterion isEmpty() { return Restrictions.isEmpty( getPropertyName() ); }
/** * Creates a property min projection * * @return The projection * * @see Projections#min */ public AggregateProjection min() { return Projections.min( getPropertyName() ); }
/** * Creates a property avg projection * * @return The projection * * @see Projections#avg */ public AggregateProjection avg() { return Projections.avg( getPropertyName() ); }
@Override public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) { return '(' + lhs.toSqlString( criteria, criteriaQuery ) + ' ' + getOp() + ' ' + rhs.toSqlString( criteria, criteriaQuery ) + ')'; }
/** * Creates a sub-query equality expression for this property * * @param subselect The sub-query * * @return The expression * * @see Subqueries#propertyEq(String, DetachedCriteria) */ public Criterion eq(DetachedCriteria subselect) { return Subqueries.propertyEq( getPropertyName(), subselect ); }
/** * Creates a sub-query less-than-or-equal-to expression for this property * * @param subselect The sub-query * * @return The expression * * @see Subqueries#propertyLe(String, DetachedCriteria) */ public Criterion le(DetachedCriteria subselect) { return Subqueries.propertyLe( getPropertyName(), subselect ); }
/** * Creates a sub-query less-than expression for this property * * @param subselect The sub-query * * @return The expression * * @see Subqueries#propertyLt(String, DetachedCriteria) */ public Criterion lt(DetachedCriteria subselect) { return Subqueries.propertyLt( getPropertyName(), subselect ); }
/** * Creates a equals-all sub-query expression for this property. I.e., {@code [prop] = ALL [subquery]} * * @param subselect The sub-query * * @return The expression * * @see Subqueries#propertyEqAll(String, DetachedCriteria) */ public Criterion eqAll(DetachedCriteria subselect) { return Subqueries.propertyEqAll( getPropertyName(), subselect ); }
@Override public String[] getColumnAliases(int loc, Criteria criteria, CriteriaQuery criteriaQuery) { return projection instanceof EnhancedProjection ? ( (EnhancedProjection) projection ).getColumnAliases( loc, criteria, criteriaQuery ) : getColumnAliases( loc ); }
@Override public String[] getColumnAliases(int loc, Criteria criteria, CriteriaQuery criteriaQuery) { return wrappedProjection instanceof EnhancedProjection ? ( (EnhancedProjection) wrappedProjection).getColumnAliases( loc, criteria, criteriaQuery ) : getColumnAliases( loc ); }