0
我使用Neo4j的彈簧數據。 模型的初步設計看起來象下面這樣:在@RelationshipEntiry中訪問Spring資料中的屬性Neo4j
@NodeEntity
public class User extends Neo4JBaseNode {
@RelatedToVia(type = "HAS_DEVICE", elementClass = UserDevice.class, direction = Direction.OUTGOING)
private List<Device> devices;
.... ommited setters,getters
}
@NodeEntity
public class Device extends Neo4JBaseNode {
private String type;
private String manufacturer;
private String model;
private String os;
.... ommited setters,getters
}
@RelationshipEntity(type = "HAS_DEVICE")
public class UserDevice {
@StartNode
private User user;
@EndNode
private Device device;
private String deviceToken;
}
我需要有「deviceToken」當用戶從數據庫中檢索,但我不知道我怎麼能做到這一點。 任何幫助,不勝感激。