org.hibernate.criterion.Restrictions.ltProperty()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(228)

本文整理了Java中org.hibernate.criterion.Restrictions.ltProperty方法的一些代码示例,展示了Restrictions.ltProperty的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Restrictions.ltProperty方法的具体详情如下:
包路径:org.hibernate.criterion.Restrictions
类名称:Restrictions
方法名:ltProperty

Restrictions.ltProperty介绍

[英]Apply a "less than" constraint to two properties
[中]对两个特性应用“小于”约束

代码示例

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Creates a less-than restriction between 2 properties
 *
 * @param other The other property to compare against
 *
 * @return The restriction
 *
 * @see Restrictions#ltProperty(String, String)
 */
@SuppressWarnings("UnusedDeclaration")
public PropertyExpression ltProperty(String other) {
  return Restrictions.ltProperty( getPropertyName(), other );
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Creates a less-than restriction between 2 properties
 *
 * @param other The other property to compare against
 *
 * @return The restriction
 *
 * @see Restrictions#ltProperty(String, String)
 */
@SuppressWarnings("UnusedDeclaration")
public PropertyExpression ltProperty(Property other) {
  return Restrictions.ltProperty( getPropertyName(), other.getPropertyName() );
}

代码示例来源:origin: TGAC/miso-lims

@Override
public void restrictPaginationByFulfilled(Criteria criteria, boolean isFulfilled, Consumer<String> errorHandler) {
 criteria.add(isFulfilled ? Restrictions.geProperty("loaded", "remaining")
   : Restrictions.ltProperty("loaded", "remaining"));
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public PropertyExpression ltProperty(String other) {
  return Restrictions.ltProperty( getPropertyName(), other );
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public PropertyExpression ltProperty(String other) {
  return Restrictions.ltProperty( getPropertyName(), other );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public PropertyExpression ltProperty(String other) {
  return Restrictions.ltProperty( getPropertyName(), other );
}

代码示例来源:origin: hibernate/hibernate

public PropertyExpression ltProperty(String other) {
  return Restrictions.ltProperty( getPropertyName(), other );
}

代码示例来源:origin: org.grails/grails-hibernate

@Override
  public org.hibernate.criterion.Criterion toHibernateCriterion(HibernateQuery hibernateQuery, Query.Criterion criterion, String alias) {
    Query.LessThanProperty eq = (Query.LessThanProperty) criterion;
    return Restrictions.ltProperty(calculatePropertyName(eq.getProperty(), alias), eq.getOtherProperty());
  }
});

代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core

@Override
  public Criterion toHibernateCriterion(AbstractHibernateQuery hibernateQuery, Query.LessThanProperty criterion, String alias) {
    String propertyName = getPropertyName(criterion, alias);
    return Restrictions.ltProperty(propertyName, criterion.getOtherProperty());
  }
});

代码示例来源:origin: com.arsframework/ars-database

/**
 * 获取属性小于匹配条件
 *
 * @param property 属性名
 * @param other    属性名
 * @return 条件匹配对象
 */
protected Criterion getPropertyLessCriterion(String property, String other) {
  return Restrictions.ltProperty(this.getCriteriaAlias(property), this.getCriteriaAlias(other));
}

代码示例来源:origin: hibernate/hibernate

public PropertyExpression ltProperty(Property other) {
  return Restrictions.ltProperty( getPropertyName(), other.getPropertyName() );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public PropertyExpression ltProperty(Property other) {
  return Restrictions.ltProperty( getPropertyName(), other.getPropertyName() );
}

代码示例来源:origin: com.atlassian.hibernate/hibernate.adapter

private static org.hibernate.criterion.Criterion adaptPropertyExpr(final PropertyExpression criterion) {
  final String propertyName = PropertyExpressionV2Reflection.getPropertyName(criterion);
  final String otherPropertyName = PropertyExpressionV2Reflection.getOtherPropertyName(criterion);
  if (criterion instanceof EqPropertyExpression)
    return org.hibernate.criterion.Restrictions.eqProperty(propertyName, otherPropertyName);
  if (criterion instanceof LtPropertyExpression)
    return org.hibernate.criterion.Restrictions.ltProperty(propertyName, otherPropertyName);
  if (criterion instanceof LePropertyExpression)
    return org.hibernate.criterion.Restrictions.leProperty(propertyName, otherPropertyName);
  throw new IllegalArgumentException("Unexpected PropertyExpression criterion: " + criterion.getClass().getName());
}

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

public PropertyExpression ltProperty(Property other) {
  return Restrictions.ltProperty( getPropertyName(), other.getPropertyName() );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public PropertyExpression ltProperty(Property other) {
  return Restrictions.ltProperty( getPropertyName(), other.getPropertyName() );
}

代码示例来源:origin: com.silicolife.textmining/core

@Override
public Long countCorpusPublicationsOutdatedProcess(Long corpusId, Long processId){
  
  Session session = sessionFactory.getCurrentSession();
  
  Criteria subQuery = session.createCriteria(CorpusHasPublicationsHasProcesses.class, "docsprocessed");
  subQuery.createAlias("docsprocessed.processes", "process", JoinType.LEFT_OUTER_JOIN, Restrictions.eq("docsprocessed.id.chphpProcessesId", processId));
  subQuery.createAlias("docsprocessed.corpusHasPublications", "allpubs", JoinType.RIGHT_OUTER_JOIN, Restrictions.eq("docsprocessed.id.chphpProcessesId", processId));
  subQuery.add(Restrictions.eq("allpubs.id.chpCorpusId", corpusId));
  subQuery.add(Restrictions.or(Restrictions.isNull("docsprocessed.id.chphpPublicationId"), 
                 Restrictions.ltProperty("docsprocessed.chphpProcessesVersion", "process.proVersion")));
  subQuery.setProjection(Projections.count("allpubs.id.chpPublicationId"));
  
  Long count = (Long) subQuery.uniqueResult();
  return count;
}

代码示例来源:origin: com.silicolife.textmining/core

subQuery.add(Restrictions.eq("allpubs.id.chpCorpusId", corpusId));
subQuery.add(Restrictions.or(Restrictions.isNull("docsprocessed.id.chphpPublicationId"), 
               Restrictions.ltProperty("docsprocessed.chphpProcessesVersion", "process.proVersion")));
subQuery.setProjection(Projections.property("allpubs.id.chpPublicationId"));

代码示例来源:origin: org.grails/grails-datastore-gorm-hibernate-core

/**
 * Creates a Criterion that tests if the first property is less than the second property
 * @param propertyName The first property name
 * @param otherPropertyName The second property name
 * @return A Criterion instance
 */
public org.grails.datastore.mapping.query.api.Criteria ltProperty(String propertyName, String otherPropertyName) {
  if (!validateSimpleExpression()) {
    throwRuntimeException(new IllegalArgumentException("Call to [ltProperty] with propertyName [" +
        propertyName + "] and other property name [" + otherPropertyName + "] not allowed here."));
  }
  propertyName = calculatePropertyName(propertyName);
  otherPropertyName = calculatePropertyName(otherPropertyName);
  addToCriteria(Restrictions.ltProperty(propertyName, otherPropertyName));
  return this;
}

代码示例来源:origin: org.grails/grails-hibernate

/**
 * Creates a Criterion that tests if the first property is less than the second property
 * @param propertyName The first property name
 * @param otherPropertyName The second property name
 * @return A Criterion instance
 */
public org.grails.datastore.mapping.query.api.Criteria ltProperty(String propertyName, String otherPropertyName) {
  if (!validateSimpleExpression()) {
    throwRuntimeException(new IllegalArgumentException("Call to [ltProperty] with propertyName [" +
        propertyName + "] and other property name [" + otherPropertyName + "] not allowed here."));
  }
  propertyName = calculatePropertyName(propertyName);
  otherPropertyName = calculatePropertyName(otherPropertyName);
  addToCriteria(Restrictions.ltProperty(propertyName, otherPropertyName));
  return this;
}

代码示例来源:origin: org.fornax.cartridges/fornax-cartridges-sculptor-framework

return Restrictions.eqProperty(makePathWithAlias(crit.getPropertyFullName()), (String) crit.getFirstOperant());
} else if (Operator.LessThanProperty.equals(operator)) {
  return Restrictions.ltProperty(makePathWithAlias(crit.getPropertyFullName()), (String) crit.getFirstOperant());
} else if (Operator.LessThanOrEqualProperty.equals(operator)) {
  return Restrictions.leProperty(makePathWithAlias(crit.getPropertyFullName()), (String) crit.getFirstOperant());

相关文章