use of com.orientechnologies.orient.test.domain.business.Account in project orientdb by orientechnologies.
the class CRUDObjectInheritanceTestSchemaFull method queryByBaseType.
@Test(dependsOnMethods = "testCreate")
public void queryByBaseType() {
database.setAutomaticSchemaGeneration(true);
final List<Account> result = database.query(new OSQLSynchQuery<Account>("select from Company where name.length() > 0"));
Assert.assertTrue(result.size() > 0);
Assert.assertEquals(result.size() - startRecordNumber, TOT_RECORDS);
int companyRecords = 0;
Account account;
for (int i = 0; i < result.size(); ++i) {
account = result.get(i);
if (account instanceof Company)
companyRecords++;
Assert.assertNotSame(account.getName().length(), 0);
}
Assert.assertEquals(companyRecords, TOT_RECORDS);
}
use of com.orientechnologies.orient.test.domain.business.Account in project orientdb by orientechnologies.
the class CRUDObjectPhysicalTest method create.
@Test
public void create() {
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.business");
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.whiz");
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.base");
startRecordNumber = database.countClass("Account");
Account account;
for (long i = startRecordNumber; i < startRecordNumber + TOT_RECORDS; ++i) {
account = new Account((int) i, "Bill", "Gates");
account.setBirthDate(new Date());
account.setSalary(i + 300.10f);
account.getAddresses().add(new Address("Residence", rome, "Piazza Navona, 1"));
database.save(account);
}
}
use of com.orientechnologies.orient.test.domain.business.Account in project orientdb by orientechnologies.
the class ObjectDetachingTest method createAnnotatedObjects.
@Test
public void createAnnotatedObjects() {
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.business");
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.whiz");
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.base");
Country austria = new Country("Austria");
City graz = new City(austria, "Graz");
graz = database.save(graz);
account = new Account();
account = database.save(account);
profile = new Profile();
profile = database.save(profile);
}
use of com.orientechnologies.orient.test.domain.business.Account in project orientdb by orientechnologies.
the class ObjectDetachingTestSchemaFull method createAnnotatedObjects.
@Test
public void createAnnotatedObjects() {
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.business");
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.whiz");
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.base");
Country austria = new Country("Austria");
City graz = new City(austria, "Graz");
graz = database.save(graz);
account = new Account();
account = database.save(account);
profile = new Profile();
profile = database.save(profile);
}
use of com.orientechnologies.orient.test.domain.business.Account in project orientdb by orientechnologies.
the class LocalCreateObjectSpeedTest method cycle.
@Override
public void cycle() {
account = new Account((int) data.getCyclesDone(), "Luca", "Garulli");
account.setBirthDate(date);
account.setSalary(3000f + data.getCyclesDone());
database.save(account);
if (data.getCyclesDone() == data.getCycles() - 1)
database.commit();
account = null;
}
Aggregations