2023-09-10 10:37:48 補(bǔ)充
注意:下面是舊版本的語(yǔ)法,如果你發(fā)現(xiàn)@NodeEntity這樣的注解沒(méi)有的話可以這樣:
@Data
@Node("person")
public class Person implements Serializable {
@Id
@GeneratedValue
private Long id;
@Property
private String name;
}
這里就要用@Node 另外如果@StartNode和@EndNode都沒(méi)有了,那么說(shuō)明是用法變了.
關(guān)于最新的用法,在官網(wǎng)有明確的說(shuō)明和案例,很有用:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-708834.html
https://neo4j.com/developer/spring-data-neo4j/
下面給出官網(wǎng)的案例:文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-708834.html
@Node("Movie")
public class MovieEntity {
@Id
private final String title;
@Property("tagline")
private final String description;
@Relationship(type = "ACTED_IN", direction = INCOMING)
private Set<PersonEntity> actors = new HashSet<>();
@Relationship(type = "DIRECTED", direction = INCOMING
到了這里,關(guān)于圖數(shù)據(jù)庫(kù)_Neo4j和SpringBoot Data整合使用_實(shí)戰(zhàn)創(chuàng)建明星關(guān)系圖譜---Neo4j圖數(shù)據(jù)庫(kù)工作筆記0010的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!