use of com.orientechnologies.orient.test.domain.business.Country in project orientdb by orientechnologies.
the class CRUDObjectPhysicalTest method update.
@Test(dependsOnMethods = "mapEnumAndInternalObjects")
public void update() {
int i = 0;
Account a;
for (Object o : database.browseClass("Account").setFetchPlan("*:1")) {
a = (Account) o;
if (i % 2 == 0)
a.getAddresses().set(0, new Address("work", new City(new Country("Spain"), "Madrid"), "Plaza central"));
a.setSalary(i + 500.10f);
database.save(a);
i++;
}
}
use of com.orientechnologies.orient.test.domain.business.Country in project orientdb by orientechnologies.
the class CRUDObjectPhysicalTest method createLinked.
@Test(dependsOnMethods = "testUpdate")
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);
}
Aggregations