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 {
Ebean.endTransaction();