Package com.testdomain

Examples of com.testdomain.Order


  }

  public void testDynCompositeKeyMapping() throws SQLException {

    Order order1 = (Order) sqlMap.queryForObject("getOrderWithDynFavouriteLineItem", new Integer(1));

    assertNotNull(order1);
    assertNotNull(order1.getFavouriteLineItem());
    assertEquals(2, order1.getFavouriteLineItem().getId());
    assertEquals(1, order1.getFavouriteLineItem().getOrderId());

  }
View Full Code Here


  public void testNestedResultMaps() throws SQLException {
    List list = sqlMap.queryForList("getAllOrdersWithNestedResultMaps");

    assertEquals(10, list.size());

    Order order = (Order) list.get(0);
    assertEquals(1, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());

    order = (Order) list.get(1);
    assertEquals(4, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());

    order = (Order) list.get(2);
    assertEquals(3, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());

    order = (Order) list.get(3);
    assertEquals(2, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());

    order = (Order) list.get(4);
    assertEquals(5, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());

    order = (Order) list.get(5);
    assertEquals(5, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());

    order = (Order) list.get(6);
    assertEquals(4, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());

    order = (Order) list.get(7);
    assertEquals(3, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());

    order = (Order) list.get(8);
    assertEquals(2, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());

    order = (Order) list.get(9);
    assertEquals(1, order.getAccount().getId());
    assertEquals(2, order.getLineItems().size());
  }
View Full Code Here

TOP

Related Classes of com.testdomain.Order

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.