Database Reference
In-Depth Information
final Friend michael =
app.create(Friend.class, "Michael");
final Friend axel =
app.create(Friend.class, "Axel");
// associate the two with each other
axel.setProperty(Friend.friends,
Arrays.asList( new Friend[] { michael } ));
// create two cities
final City dresden =
app.create(City.class, "Dresden");
final City frankfurt =
app.create(City.class, "Frankfurt");
// associate the friends with the cities
michael.setProperty(Friend.city, dresden);
axel.setProperty(Friend.city, frankfurt);
// type-safe property access with
compile-time multiplicity check
final List<Friend> michaelsFriends =
michael.getProperty(Friend.friends);
final List<Friend> axelsFriends =
axel.getProperty(Friend.friends);
final City michaelsCity =
michael.getProperty(Friend.city);
final City axelsCity =
axel.getProperty(Friend.city);
// type-safe relationship access with
compile-time direction check
final LiveIn liveInRelationship =
axel.getOutgoingRelationship(LiveIn.class);
Search WWH ::




Custom Search