updated interface documentation, added getRelationshipId() to RelationshipBacked interface
This commit is contained in:
@@ -50,7 +50,7 @@ public interface NodeBacked extends GraphBacked<Node> {
|
||||
* public class Person {
|
||||
* ...
|
||||
* public Friendship knows(Person p) {
|
||||
* return (Friendship) relateTo(p, Friendship.class, "knows");
|
||||
* return relateTo(p, Friendship.class, "knows");
|
||||
* }
|
||||
* ...
|
||||
* }
|
||||
@@ -75,8 +75,6 @@ public interface NodeBacked extends GraphBacked<Node> {
|
||||
|
||||
|
||||
/**
|
||||
* Get the ID of the entity.
|
||||
*
|
||||
* @return underlying node ID, or null if there is no underlying node
|
||||
*/
|
||||
Long getNodeId();
|
||||
@@ -122,6 +120,14 @@ public interface NodeBacked extends GraphBacked<Node> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Finds the relationship of the specified type, from this entity's underlying node to the target entity's
|
||||
* underlying node.
|
||||
*
|
||||
* @param target end node of relationship
|
||||
* @param type type of the sought relationship
|
||||
* @return requested relationship if it was found, null otherwise
|
||||
*/
|
||||
Relationship getRelationshipTo(NodeBacked target, String type);
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,11 +31,17 @@ public interface RelationshipBacked extends GraphBacked<Relationship>{
|
||||
|
||||
|
||||
/**
|
||||
* Reify this relationship entity as another relationship backed type. The same underlying relationship will be
|
||||
* Project this relationship entity as another relationship backed type. The same underlying relationship will be
|
||||
* used for the new entity.
|
||||
*
|
||||
* @param targetType type to project to
|
||||
* @return new instance of specified type, sharing the same underlying relationship with this entity
|
||||
*/
|
||||
<R extends RelationshipBacked> R projectTo(Class<R> targetType);
|
||||
|
||||
|
||||
/**
|
||||
* @return the id of the underlying relationship or null if there is none
|
||||
*/
|
||||
Long getRelationshipId();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user