Organise imports

This commit is contained in:
rbygrave
2012-10-02 13:34:30 +13:00
parent 902990e159
commit 21d63c7424
83 changed files with 5188 additions and 5156 deletions
@@ -1,39 +1,40 @@
package com.avaje.tests.singleTableInheritance;
import com.avaje.ebean.Ebean;
import com.avaje.tests.singleTableInheritance.model.PalletLocation;
import com.avaje.tests.singleTableInheritance.model.PalletLocationExternal;
import com.avaje.tests.singleTableInheritance.model.Zone;
import com.avaje.tests.singleTableInheritance.model.ZoneExternal;
import junit.framework.Assert;
import junit.framework.TestCase;
import java.util.List;
public class TestInheritQuery extends TestCase {
public void test() {
ZoneExternal zone = new ZoneExternal();
zone.setAttribute("ABC");
Ebean.save(zone);
PalletLocationExternal location = new PalletLocationExternal();
location.setZone(zone);
location.setAttribute("123");
Ebean.save(location);
// This line should work too:
List<PalletLocation> locations = Ebean.find(PalletLocation.class).where().eq("zone", zone).findList();
// List<PalletLocation> locations = Ebean.find(PalletLocation.class).where().eq("zone.id", zone.getId()).findList();
Assert.assertNotNull(locations);
Assert.assertEquals(1, locations.size());
PalletLocation rereadLoc = locations.get(0);
Assert.assertTrue(rereadLoc instanceof PalletLocation);
Zone rereadZone = rereadLoc.getZone();
Assert.assertNotNull(rereadZone);
Assert.assertTrue(rereadZone instanceof ZoneExternal);
}
package com.avaje.tests.singleTableInheritance;
import java.util.List;
import junit.framework.Assert;
import junit.framework.TestCase;
import com.avaje.ebean.Ebean;
import com.avaje.tests.singleTableInheritance.model.PalletLocation;
import com.avaje.tests.singleTableInheritance.model.PalletLocationExternal;
import com.avaje.tests.singleTableInheritance.model.Zone;
import com.avaje.tests.singleTableInheritance.model.ZoneExternal;
public class TestInheritQuery extends TestCase {
public void test() {
ZoneExternal zone = new ZoneExternal();
zone.setAttribute("ABC");
Ebean.save(zone);
PalletLocationExternal location = new PalletLocationExternal();
location.setZone(zone);
location.setAttribute("123");
Ebean.save(location);
// This line should work too:
List<PalletLocation> locations = Ebean.find(PalletLocation.class).where().eq("zone", zone).findList();
// List<PalletLocation> locations = Ebean.find(PalletLocation.class).where().eq("zone.id", zone.getId()).findList();
Assert.assertNotNull(locations);
Assert.assertEquals(1, locations.size());
PalletLocation rereadLoc = locations.get(0);
Assert.assertTrue(rereadLoc instanceof PalletLocation);
Zone rereadZone = rereadLoc.getZone();
Assert.assertNotNull(rereadZone);
Assert.assertTrue(rereadZone instanceof ZoneExternal);
}
}