use of com.orientechnologies.orient.test.domain.business.Address in project orientdb by orientechnologies.
the class CRUDObjectPhysicalTestSchemaFull method create.
@Test
public void create() {
createBasicTestSchema();
database.setAutomaticSchemaGeneration(true);
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.business");
if (url.startsWith(OEngineRemote.NAME)) {
database.getMetadata().reload();
}
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.base");
if (url.startsWith(OEngineRemote.NAME)) {
database.getMetadata().reload();
}
database.setAutomaticSchemaGeneration(false);
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.whiz");
if (url.startsWith(OEngineRemote.NAME)) {
database.getMetadata().reload();
}
startRecordNumber = database.countClusterElements("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.Address in project orientdb by orientechnologies.
the class CRUDObjectInheritanceTest method create.
@Test
public void create() {
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.business");
database.command(new OCommandSQL("delete from Company")).execute();
startRecordNumber = database.countClass("Company");
Company company;
for (long i = startRecordNumber; i < startRecordNumber + TOT_RECORDS; ++i) {
company = database.newInstance(Company.class, (int) i, "Microsoft" + i);
company.setEmployees((int) (100000 + i));
company.getAddresses().add(new Address("Headquarter", redmond, "WA 98073-9717"));
database.save(company);
}
}
use of com.orientechnologies.orient.test.domain.business.Address in project orientdb by orientechnologies.
the class CRUDObjectPhysicalTestSchemaFull method createLinked.
@Test(dependsOnMethods = "testSaveMultiCircular")
public void createLinked() {
long profiles = database.countClass("Profile");
Profile neo = new Profile("Neo").setValue("test").setLocation(new Address("residence", new City(new Country("Spain"), "Madrid"), "Rio de Castilla"));
neo.addFollowing(new Profile("Morpheus"));
neo.addFollowing(new Profile("Trinity"));
database.save(neo);
Assert.assertEquals(database.countClass("Profile"), profiles + 3);
}
use of com.orientechnologies.orient.test.domain.business.Address in project orientdb by orientechnologies.
the class CRUDObjectInheritanceTestSchemaFull method create.
@Test
public void create() {
database.getMetadata().getSchema().reload();
database.getMetadata().getSchema().synchronizeSchema();
database.setAutomaticSchemaGeneration(true);
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.business");
if (url.startsWith(OEngineRemote.NAME)) {
database.getMetadata().reload();
}
database.getEntityManager().registerEntityClasses("com.orientechnologies.orient.test.domain.base");
if (url.startsWith(OEngineRemote.NAME)) {
database.getMetadata().reload();
}
startRecordNumber = database.countClass("Company");
Company company;
for (long i = startRecordNumber; i < startRecordNumber + TOT_RECORDS; ++i) {
company = database.newInstance(Company.class, (int) i, "Microsoft" + i);
company.setEmployees((int) (100000 + i));
company.getAddresses().add(new Address("Headquarter", redmond, "WA 98073-9717"));
database.save(company);
}
}
use of com.orientechnologies.orient.test.domain.business.Address 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);
}
}
Aggregations