尽管启动顺序正确,Spring Boot Neo4j Relation无法保存

时间:2019-06-04 20:57:29

标签: java spring spring-boot spring-data-neo4j

我有一个finish

User

a @NodeEntity public class User { @Id @Index(primary = true) private Long iD; private String Name; private String location; private int friends; private boolean verified; private int followers; @Relationship(type = "Follows", direction = Relationship.OUTGOING) private Set<User> follows; //relate tweets to a particular user @Relationship(type = "Tweeted", direction = Relationship.OUTGOING) private Set<Tweeted> tweets; @Relationship(type = "Mentions", direction = Relationship.INCOMING) private Set<Mentions> mentioned;

Tweet

和关系@NodeEntity public class Tweet { @Id @Index(primary=true) @Relationship(type= "Tweeted", direction = Relationship.INCOMING) private User user; private int favouriteCount; private boolean isRetweeted; private String urlEntities; private Date date; private String Text; private Long tweetedBy; private Long tweetID; private int retweetCount;

Tweeted

我相信我已经正确设置以确保 @RelationshipEntity(type = "Tweeted") public class Tweeted { @Id @GeneratedValue private long id; @StartNode private User user; @EndNode private Tweet Tweet; @Property private Date date; 关系。但是,当我保存第一条推文时:通过我的(User)-[Tweeted]->(Tweet)中的此方法:

TweetService

该鸣叫在那里,用户在那里,但是它们之间没有关系。有人可以查看我是否正确设置了持久性吗?

0 个答案:

没有答案