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

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

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

Restrictions.eqProperty介绍

[英]Apply an "equal" constraint to two properties
[中]对两个特性应用“相等”约束

代码示例

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

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

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

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

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

.add( Restrictions.eqProperty("integer", "integer") )
.add( Restrictions.like( "string", f.getString().toUpperCase(Locale.ROOT) ).ignoreCase() )
.add( Restrictions.in( "boolean", f.getBoolean(), f.getBoolean() ) )

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see org.openmrs.api.db.LocationDAO#getLocationsHavingAllTags(java.util.List)
 */
@Override
public List<Location> getLocationsHavingAllTags(List<LocationTag> tags) {
  tags.removeAll(Collections.singleton(null));
  
  DetachedCriteria numberOfMatchingTags = DetachedCriteria.forClass(Location.class, "alias").createAlias("alias.tags",
    "locationTag").add(Restrictions.in("locationTag.locationTagId", getLocationTagIds(tags))).setProjection(
    Projections.rowCount()).add(Restrictions.eqProperty("alias.locationId", "outer.locationId"));
  
  return sessionFactory.getCurrentSession().createCriteria(Location.class, "outer").add(
    Restrictions.eq("retired", false)).add(Subqueries.eq(Long.valueOf(tags.size()), numberOfMatchingTags)).list();
}

代码示例来源:origin: openmrs/openmrs-core

crit2.add(Restrictions.eqProperty("ff.form.formId", "form.formId"));
crit2.add(Restrictions.in("ff.field", fields));

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

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

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

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

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

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

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

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

代码示例来源:origin: OpenNMS/opennms

@Override
public void visitEqProperty(final EqPropertyRestriction restriction) {
  m_criterions.add(org.hibernate.criterion.Restrictions.eqProperty(restriction.getAttribute(), restriction.getValue().toString()));
}

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

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

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

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

代码示例来源:origin: org.n52.sensorweb.sos/hibernate-utils

/**
 * Creates a {@code Criterion} that checks that the persisted period is a instant period ({@code begin == end}).
 *
 * @param r the property names
 *
 * @return the {@code Criterion}
 */
static PropertyExpression isInstant(TimePrimitiveFieldDescriptor r) {
  return Restrictions.eqProperty(r.getBeginPosition(), r.getEndPosition());
}

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

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

代码示例来源:origin: 52North/SOS

/**
 * Creates a {@code Criterion} that checks that the persisted period is a instant period ({@code begin == end}).
 *
 * @param r the property names
 *
 * @return the {@code Criterion}
 */
static PropertyExpression isInstant(TimePrimitiveFieldDescriptor r) {
  return Restrictions.eqProperty(r.getBeginPosition(), r.getEndPosition());
}

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

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

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

public PropertyExpression eqProperty(Property other) {
  return Restrictions.eqProperty( 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: org.hibernate/com.springsource.org.hibernate.core

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

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

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

相关文章