Package org.hibernate.ejb.metamodel

Examples of org.hibernate.ejb.metamodel.MetamodelImpl


  public void testEqualityComparisonLiteralConversion() {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();

    CriteriaBuilderImpl cb = (CriteriaBuilderImpl) em.getCriteriaBuilder();
    MetamodelImpl mm = (MetamodelImpl) em.getMetamodel();

        CriteriaQuery<Integer> cquery = cb.createQuery( Integer.class );
    Root<Product> product = cquery.from( Product.class );
    EntityType<Product> Product_ = mm.entity( Product.class );

    cquery.select(
        cb.toInteger(
            product.get(
                Product_.getSingularAttribute("quantity", Integer.class))
View Full Code Here



    em.getTransaction().begin();

    CriteriaBuilderImpl cb = (CriteriaBuilderImpl) em.getCriteriaBuilder();
    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 ) ),
View Full Code Here

  public void testTypeConversion() {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    CriteriaBuilderImpl cb = (CriteriaBuilderImpl) em.getCriteriaBuilder();
    MetamodelImpl mm = (MetamodelImpl) em.getMetamodel();
    EntityType<Product> Product_ = mm.entity( Product.class );

    // toFloat
        CriteriaQuery<Float> floatQuery = cb.createQuery( Float.class );
    Root<Product> product = floatQuery.from( Product.class );
    floatQuery.select(
View Full Code Here

  public void testConstructor() {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    CriteriaBuilderImpl cb = (CriteriaBuilderImpl) em.getCriteriaBuilder();
    MetamodelImpl mm = (MetamodelImpl) em.getMetamodel();

        CriteriaQuery<Customer> cquery = cb.createQuery(Customer.class);
    Root<Customer> customer = cquery.from(Customer.class);
    EntityType<Customer> Customer_ = customer.getModel();
View Full Code Here

  public void testDateTimeFunctions() {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    CriteriaBuilderImpl cb = (CriteriaBuilderImpl) em.getCriteriaBuilder();
    MetamodelImpl mm = (MetamodelImpl) em.getMetamodel();

        CriteriaQuery<java.sql.Date> dateQuery = cb.createQuery(java.sql.Date.class);
    dateQuery.from( Customer.class );
    dateQuery.select( cb.currentDate() );
    em.createQuery( dateQuery ).getResultList();
View Full Code Here

TOP

Related Classes of org.hibernate.ejb.metamodel.MetamodelImpl

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.