use of com.orientechnologies.orient.test.domain.inheritance.InheritanceTestBaseClass in project orientdb by orientechnologies.
the class CRUDObjectInheritanceTest method testIdFieldInheritanceFirstSubClass.
@Test(dependsOnMethods = "testIdFieldInheritance")
public void testIdFieldInheritanceFirstSubClass() {
database.getEntityManager().registerEntityClass(InheritanceTestClass.class);
database.getEntityManager().registerEntityClass(InheritanceTestBaseClass.class);
InheritanceTestBaseClass a = database.newInstance(InheritanceTestBaseClass.class);
InheritanceTestBaseClass b = database.newInstance(InheritanceTestClass.class);
database.save(a);
database.save(b);
final List<InheritanceTestBaseClass> result1 = database.query(new OSQLSynchQuery<InheritanceTestBaseClass>("select from InheritanceTestBaseClass"));
Assert.assertEquals(2, result1.size());
}
use of com.orientechnologies.orient.test.domain.inheritance.InheritanceTestBaseClass in project orientdb by orientechnologies.
the class CRUDObjectInheritanceTestSchemaFull method testIdFieldInheritanceFirstSubClass.
@Test(dependsOnMethods = "testIdFieldInheritance")
public void testIdFieldInheritanceFirstSubClass() {
database.setAutomaticSchemaGeneration(true);
database.command(new OCommandSQL("delete from InheritanceTestBaseClass")).execute();
database.command(new OCommandSQL("delete from InheritanceTestClass")).execute();
database.getEntityManager().registerEntityClass(InheritanceTestClass.class);
database.getEntityManager().registerEntityClass(InheritanceTestBaseClass.class);
InheritanceTestBaseClass a = database.newInstance(InheritanceTestBaseClass.class);
InheritanceTestBaseClass b = database.newInstance(InheritanceTestClass.class);
database.save(a);
database.save(b);
final List<InheritanceTestBaseClass> result1 = database.query(new OSQLSynchQuery<InheritanceTestBaseClass>("select from InheritanceTestBaseClass"));
Assert.assertEquals(2, result1.size());
}
Aggregations