Package org.hibernate.ejb.test

Examples of org.hibernate.ejb.test.Wallet


  }

  public void testExplicitPositionalParameter() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Wallet w = new Wallet();
    w.setBrand( "Lacoste" );
    w.setModel( "Minimic" );
    w.setSerial( "0100202002" );
    em.persist( w );
    em.getTransaction().commit();
    em.getTransaction().begin();
    Query query = em.createQuery( "select w from " + Wallet.class.getName() + " w where w.brand in ?1" );
    List brands = new ArrayList();
View Full Code Here


  }

  public void testPositionalParameterForms() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Wallet w = new Wallet();
    w.setBrand( "Lacoste" );
    w.setModel( "Minimic" );
    w.setSerial( "0100202002" );
    em.persist( w );
    em.getTransaction().commit();

    em.getTransaction().begin();
    // first using jpa-style positional parameter
View Full Code Here

  }

  public void testPositionalParameterWithUserError() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Wallet w = new Wallet();
    w.setBrand( "Lacoste" );
    w.setModel( "Minimic" );
    w.setSerial( "0100202002" );
    em.persist( w );
    em.flush();


    try {
View Full Code Here

  }

  public void testNativeQuestionMarkParameter() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Wallet w = new Wallet();
    w.setBrand( "Lacoste" );
    w.setModel( "Minimic" );
    w.setSerial( "0100202002" );
    em.persist( w );
    em.getTransaction().commit();
    em.getTransaction().begin();
    Query query = em.createNativeQuery( "select * from Wallet w where w.brand = ?", Wallet.class );
    query.setParameter( 1, "Lacoste" );
View Full Code Here

TOP

Related Classes of org.hibernate.ejb.test.Wallet

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.