Package org.hibernate.ejb.criteria.predicate

Examples of org.hibernate.ejb.criteria.predicate.ComparisonPredicate


            product.get(
                Product_.getSingularAttribute("quantity", Integer.class))
        )
    );

    ComparisonPredicate predicate = (ComparisonPredicate) cb.equal(
        product.get( Product_.getSingularAttribute( "partNumber", Long.class ) ),
        373767373
    );
    assertEquals( Long.class, predicate.getRightHandOperand().getJavaType() );
    cquery.where( predicate );
    em.createQuery( cquery ).getResultList();

    predicate = (ComparisonPredicate) cb.ge(
        cb.length( product.get( Product_.getSingularAttribute( "name", String.class ) ) ),
        4L
    );
    assertEquals( Integer.class, predicate.getRightHandOperand().getJavaType() );
    cquery.where( predicate );
    em.createQuery( cquery ).getResultList();

    em.getTransaction().commit();
    em.close();
View Full Code Here


    MetamodelImpl mm = (MetamodelImpl) em.getMetamodel();
    EntityType<Phone> Phone_ = mm.entity( Phone.class );

    CriteriaQuery<Phone> cquery = cb.createQuery( Phone.class );
    Root<Phone> phone = cquery.from( Phone.class );
    ComparisonPredicate predicate = (ComparisonPredicate) cb.equal(
        phone.get( Phone_.getSingularAttribute( "address", Address.class ) ),
        address
    );
    cquery.where( predicate );
    List<Phone> results = em.createQuery( cquery ).getResultList();
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Predicate equal(Expression<?> x, Expression<?> y) {
    //noinspection SuspiciousNameCombination
    return new ComparisonPredicate( this, ComparisonOperator.EQUAL, x, y );
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Predicate notEqual(Expression<?> x, Expression<?> y) {
    //noinspection SuspiciousNameCombination
    return new ComparisonPredicate( this, ComparisonOperator.NOT_EQUAL, x, y );
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Predicate equal(Expression<?> x, Object y) {
    //noinspection SuspiciousNameCombination
    return new ComparisonPredicate( this, ComparisonOperator.EQUAL, x, y );
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public Predicate notEqual(Expression<?> x, Object y) {
    //noinspection SuspiciousNameCombination
    return new ComparisonPredicate( this, ComparisonOperator.NOT_EQUAL, x, y );
  }
View Full Code Here

  /**
   * {@inheritDoc}
   */
  public <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x, Expression<? extends Y> y) {
    //noinspection SuspiciousNameCombination
    return new ComparisonPredicate( this, ComparisonOperator.GREATER_THAN, x, y );
  }
View Full Code Here

   */
  public <Y extends Comparable<? super Y>> Predicate lessThan(
      Expression<? extends Y> x,
      Expression<? extends Y> y) {
    //noinspection SuspiciousNameCombination
    return new ComparisonPredicate( this, ComparisonOperator.LESS_THAN, x, y );
  }
View Full Code Here

   */
  public <Y extends Comparable<? super Y>> Predicate greaterThanOrEqualTo(
      Expression<? extends Y> x,
      Expression<? extends Y> y) {
    //noinspection SuspiciousNameCombination
    return new ComparisonPredicate( this, ComparisonOperator.GREATER_THAN_OR_EQUAL, x, y );
  }
View Full Code Here

   */
  public <Y extends Comparable<? super Y>> Predicate lessThanOrEqualTo(
      Expression<? extends Y> x,
      Expression<? extends Y> y) {
    //noinspection SuspiciousNameCombination
    return new ComparisonPredicate( this, ComparisonOperator.LESS_THAN_OR_EQUAL, x, y );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ejb.criteria.predicate.ComparisonPredicate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.