Package org.hibernate.test.cid

Examples of org.hibernate.test.cid.Product


  public void testImplicitPolymorphism() {
    Session s = openSession();
    Transaction t = s.beginTransaction();

    Product product = new Product();
    product.setDescription( "My Product" );
    product.setNumberAvailable( 10 );
    product.setPrice( new BigDecimal( 123 ) );
    product.setProductId( "4321" );
    s.save( product );

    List list = s.createQuery("from java.lang.Comparable").list();
    assertEquals( list.size(), 0 );
View Full Code Here


  public void testOneToManyFilter() throws Throwable {
    Session session = openSession();
    Transaction txn = session.beginTransaction();

    Product product = new Product();
    product.setDescription( "My Product" );
    product.setNumberAvailable( 10 );
    product.setPrice( new BigDecimal( 123 ) );
    product.setProductId( "4321" );
    session.save( product );

    Customer customer = new Customer();
    customer.setCustomerId( "123456789" );
    customer.setName( "My customer" );
View Full Code Here

  }

  public void testStandardFunctions() throws Exception {
    Session session = openSession();
    Transaction t = session.beginTransaction();
    Product p = new Product();
    p.setDescription("a product");
    p.setPrice( new BigDecimal(1.0) );
    p.setProductId("abc123");
    session.persist(p);
    Object[] result = (Object[]) session
      .createQuery("select current_time(), current_date(), current_timestamp() from Product")
      .uniqueResult();
    assertTrue( result[0] instanceof Time );
View Full Code Here

  }

  public void testRowValueConstructorSyntaxInInList() {
    Session s = openSession();
    s.beginTransaction();
    Product product = new Product();
    product.setDescription( "My Product" );
    product.setNumberAvailable( 10 );
    product.setPrice( new BigDecimal( 123 ) );
    product.setProductId( "4321" );
    s.save( product );
   

    Customer customer = new Customer();
    customer.setCustomerId( "123456789" );
    customer.setName( "My customer" );
    customer.setAddress( "somewhere" );
    s.save( customer );

    Order order = customer.generateNewOrder( new BigDecimal( 1234 ) );
    s.save( order );

    LineItem li = order.generateLineItem( product, 5 );
    s.save( li );
    product = new Product();
    product.setDescription( "My Product" );
    product.setNumberAvailable( 10 );
    product.setPrice( new BigDecimal( 123 ) );
    product.setProductId( "1234" );
    s.save( product );
    li = order.generateLineItem( product, 10 );
    s.save( li );

    s.flush();
View Full Code Here

      return;
    }
    Session s = openSession();
    Transaction t = s.beginTransaction();

    Product product = new Product();
    product.setDescription( "My Product" );
    product.setNumberAvailable( 10 );
    product.setPrice( new BigDecimal( 123 ) );
    product.setProductId( "4321" );
    s.save( product );

    List list = s.createQuery("from java.lang.Comparable").list();
    assertEquals( list.size(), 0 );
View Full Code Here

      return;
    }
    Session session = openSession();
    Transaction txn = session.beginTransaction();

    Product product = new Product();
    product.setDescription( "My Product" );
    product.setNumberAvailable( 10 );
    product.setPrice( new BigDecimal( 123 ) );
    product.setProductId( "4321" );
    session.save( product );

    Customer customer = new Customer();
    customer.setCustomerId( "123456789" );
    customer.setName( "My customer" );
View Full Code Here

  }

  public void testStandardFunctions() throws Exception {
    Session session = openSession();
    Transaction t = session.beginTransaction();
    Product p = new Product();
    p.setDescription("a product");
    p.setPrice( new BigDecimal(1.0) );
    p.setProductId("abc123");
    session.persist(p);
    Object[] result = (Object[]) session
      .createQuery("select current_time(), current_date(), current_timestamp() from Product")
      .uniqueResult();
    assertTrue( result[0] instanceof Time );
View Full Code Here

  public void testImplicitPolymorphism() {
    Session s = openSession();
    Transaction t = s.beginTransaction();

    Product product = new Product();
    product.setDescription( "My Product" );
    product.setNumberAvailable( 10 );
    product.setPrice( new BigDecimal( 123 ) );
    product.setProductId( "4321" );
    s.save( product );

    List list = s.createQuery("from java.lang.Comparable").list();
    assertEquals( list.size(), 0 );
View Full Code Here

  public void testOneToManyFilter() throws Throwable {
    Session session = openSession();
    Transaction txn = session.beginTransaction();

    Product product = new Product();
    product.setDescription( "My Product" );
    product.setNumberAvailable( 10 );
    product.setPrice( new BigDecimal( 123 ) );
    product.setProductId( "4321" );
    session.save( product );

    Customer customer = new Customer();
    customer.setCustomerId( "123456789" );
    customer.setName( "My customer" );
View Full Code Here

  }

  public void testStandardFunctions() throws Exception {
    Session session = openSession();
    Transaction t = session.beginTransaction();
    Product p = new Product();
    p.setDescription("a product");
    p.setPrice( new BigDecimal(1.0) );
    p.setProductId("abc123");
    session.persist(p);
    Object[] result = (Object[]) session
      .createQuery("select current_time(), current_date(), current_timestamp() from Product")
      .uniqueResult();
    assertTrue( result[0] instanceof Time );
View Full Code Here

TOP

Related Classes of org.hibernate.test.cid.Product

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.