Search in sources :

Example 1 with InheritanceTestBaseClass

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());
}
Also used : InheritanceTestBaseClass(com.orientechnologies.orient.test.domain.inheritance.InheritanceTestBaseClass) Test(org.testng.annotations.Test)

Example 2 with InheritanceTestBaseClass

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());
}
Also used : OCommandSQL(com.orientechnologies.orient.core.sql.OCommandSQL) InheritanceTestBaseClass(com.orientechnologies.orient.test.domain.inheritance.InheritanceTestBaseClass) Test(org.testng.annotations.Test)

Aggregations

InheritanceTestBaseClass (com.orientechnologies.orient.test.domain.inheritance.InheritanceTestBaseClass)2 Test (org.testng.annotations.Test)2 OCommandSQL (com.orientechnologies.orient.core.sql.OCommandSQL)1