@GraphId Long nodeId;
/** * Definition of a Relationship which does not actually exist, or rather the * name of the RelationshipType does not exist in an existing Neo4j graph. */ @RelationshipEntity(type = "DODGY_REL_DEF") public class DodgyRelDef { @GraphId Long nodeId; }
/** * Created by david on 2014-11-06. */ @NodeEntity public class Tweet { @GraphId Long id; public String text; public Date createdAt = new Date(); public String languageCode; public Tweet() { } public Tweet(String text, Date createdAt, String languageCode) { this.text = text; this.createdAt = createdAt; this.languageCode = languageCode; } }
@NodeEntity public class Person { @GraphId private Long id; private String userName;
/** * Created by david on 2014-11-06. */ @NodeEntity public class Profile { @GraphId Long id; @Indexed(unique=true) public String screenName; public Profile() { } public Profile(String screenName) { this.screenName = screenName; } }
/** * Created by david on 2014-09-17. */ @RelationshipEntity(type = "Mention") public class Mention { @GraphId Long id; @StartNode public Tweet tweet; @EndNode public Profile profile; }
/** * Created by david on 2014-12-22. */ @RelationshipEntity(type = "Author") public class Author { @GraphId Long id; @StartNode public Tweet tweet; @EndNode public Profile profile; }
/** * Created by david on 2014-09-17. */ @RelationshipEntity(type = "Tag") public class Tag { @GraphId Long id; @StartNode Tweet tweet; @EndNode Keyword keyword; }
@NodeEntity public class Product { @GraphId private Long id;
/** * Created by david on 2014-09-17. */ @RelationshipEntity(type = "Connected") public class Connected { @GraphId Long id; @StartNode Keyword start; @EndNode Keyword end; int count; public int getCount() { return count; } public void setCount(int count) { this.count = count; } }
@NodeEntity public class Movie { @GraphId Long nodeId; String title;
@RelationshipEntity(type = "LIKES") public class Likes { @GraphId private Long id;
@GraphId Long relationshipId;
@GraphId private Long relationId;
public static final String FIELD_ID = "id"; @GraphId private Long nodeId;