Package org.hibernate.ejb.test

Examples of org.hibernate.ejb.test.Distributor


    File testPackage = buildExplicitPar();
    addPackageToClasspath( testPackage );

    EntityManagerFactory emf = Persistence.createEntityManagerFactory( "manager1", new HashMap() );
    Item item = new Item( "Mouse", "Micro$oft mouse" );
    Distributor res = new Distributor();
    res.setName( "Bruce" );
    item.setDistributors( new HashSet<Distributor>() );
    item.getDistributors().add( res );
    Statistics stats = ( ( HibernateEntityManagerFactory ) emf ).getSessionFactory().getStatistics();
    stats.clear();
    stats.setStatisticsEnabled( true );
View Full Code Here


  public void testDistinct() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    em.createQuery( "delete Item" ).executeUpdate();
    em.createQuery( "delete Distributor" ).executeUpdate();
    Distributor d1 = new Distributor();
    d1.setName( "Fnac" );
    Distributor d2 = new Distributor();
    d2.setName( "Darty" );
    Item item = new Item( "Mouse", "Micro$oft mouse" );
    item.getDistributors().add( d1 );
    item.getDistributors().add( d2 );
    em.persist( d1 );
    em.persist( d2 );
View Full Code Here

  }

  public void testIsNull() throws Exception {
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Distributor d1 = new Distributor();
    d1.setName( "Fnac" );
    Distributor d2 = new Distributor();
    d2.setName( "Darty" );
    Item item = new Item( "Mouse", null );
    Item item2 = new Item( "Mouse2", "dd" );
    item.getDistributors().add( d1 );
    item.getDistributors().add( d2 );
    em.persist( d1 );
View Full Code Here

TOP

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

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.