Package com.avaje.tests.model.basic

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


public class TestMultipleOneToOneIUD extends BaseTestCase {

  @Test
  public void test() {

    OEngine engine = new OEngine();
    engine.setShortDesc("engine 1");

    OGearBox gearBox = new OGearBox();
    gearBox.setBoxDesc("6 speed manual");
    gearBox.setSize(6);

    OCar car = new OCar();
    car.setVin("xx4534");
    car.setName("test car");
    car.setEngine(engine);

    Ebean.beginTransaction();
    try {
      Ebean.save(gearBox);
      Ebean.save(car);

      Assert.assertNotNull(car.getId());
      Assert.assertNotNull(engine.getEngineId());
      Assert.assertNotNull(gearBox.getId());

      Ebean.commitTransaction();

    } finally {
View Full Code Here

TOP

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

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.