Example usage for org.hibernate.criterion Restrictions eqProperty

List of usage examples for org.hibernate.criterion Restrictions eqProperty

Introduction

In this page you can find the example usage for org.hibernate.criterion Restrictions eqProperty.

Prototype

public static PropertyExpression eqProperty(String propertyName, String otherPropertyName) 

Source Link

Document

Apply an "equal" constraint to two properties

Usage

From source file:to.etc.domui.hibernate.model.CriteriaCreatingVisitor.java

License:Open Source License

@Override
public void visitPropertyJoinComparison(@NonNull QPropertyJoinComparison comparison) throws Exception {
    String alias = m_parentAlias + "." + parseSubcriteria(comparison.getParentProperty());
    switch (comparison.getOperation()) {
    default:/*from   ww w. j a v a 2 s  .c  o  m*/
        throw new QQuerySyntaxException("Unsupported parent-join operation: " + comparison.getOperation());

    case EQ:
        m_last = Restrictions.eqProperty(alias, comparison.getSubProperty());
        break;

    case NE:
        m_last = Restrictions.neProperty(alias, comparison.getSubProperty());
        break;

    case LT:
        m_last = Restrictions.ltProperty(alias, comparison.getSubProperty());
        break;

    case LE:
        m_last = Restrictions.leProperty(alias, comparison.getSubProperty());
        break;

    case GT:
        m_last = Restrictions.gtProperty(alias, comparison.getSubProperty());
        break;

    case GE:
        m_last = Restrictions.geProperty(alias, comparison.getSubProperty());
        break;
    }
}