Package com.avaje.tests.model.basic

Examples of com.avaje.tests.model.basic.OrderDetail


    // lazy load
    bc.size();
   
    Assert.assertTrue(bc.isPopulated());
    Assert.assertTrue(bc.size() > 0);
    OrderDetail detail = details.get(0);
   
    Assert.assertTrue(Ebean.getBeanState(detail).isReadOnly());
    Assert.assertFalse(Ebean.getBeanState(detail).isReference());
   
    Product product = detail.getProduct();

    Assert.assertTrue(Ebean.getBeanState(product).isReadOnly());
   
    // lazy load
    product.getName();
View Full Code Here


    bc.size();
    Assert.assertTrue(bc.size() > 0);
    Assert.assertTrue(bc.isReadOnly());
    Assert.assertTrue(bc.isPopulated());
    try {
      details.add(new OrderDetail());
      Assert.assertTrue(false);     
    } catch (IllegalStateException e){
      Assert.assertTrue(true);     
    }
    try {
View Full Code Here

  @Test
  public void test() {

    ResetBasicData.reset();

    OrderDetail dummy = Ebean.getReference(OrderDetail.class, 1);
    SpiEbeanServer server = (SpiEbeanServer) Ebean.getServer(null);
    server.getBeanDescriptor(OrderDetail.class).cacheBeanPut(dummy);

    Customer cust = ResetBasicData.createCustAndOrder("DelCas");
    Assert.assertNotNull(cust);
View Full Code Here

  @Test
  public void test() {

    ResetBasicData.reset();

    OrderDetail dummy = Ebean.getReference(OrderDetail.class, 1);
    SpiEbeanServer server = (SpiEbeanServer) Ebean.getServer(null);
    server.getBeanDescriptor(OrderDetail.class).cacheBeanPut(dummy);

    Customer c0 = ResetBasicData.createCustAndOrder("DelIdList-0");
    Assert.assertNotNull(c0);
View Full Code Here

    Customer cref = Ebean.getReference(Customer.class, c0.getId());
    order.setCustomer(cref);
    order.setStatus(Status.SHIPPED);

    OrderDetail orderDetail0 = order.getDetails().get(0);
    orderDetail0.setShipQty(300);
    orderDetail0.setUnitPrice(56.98d);

    // remove one of the details...
    OrderDetail removedDetail = order.getDetails().remove(2);
    Assert.assertNotNull(removedDetail);

    Product p = Ebean.getReference(Product.class, 1);
    OrderDetail newDetail = new OrderDetail(p, 899, 12.12d);
    // newDetail.setOrder(order);
    order.addDetail(newDetail);

    EbeanServer server = Ebean.getServer(null);
View Full Code Here

TOP

Related Classes of com.avaje.tests.model.basic.OrderDetail

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.