我需要创建一个A类的新节点,它与User节点有关系:
@NodeEntity
public class A implements Serializable {
/**
* Graph node identifier
*/
@GraphId
private Long nodeId;
/**
* Enity identifier
*/
private String id;
//... more properties ...
@Relationship(type = "HAS_ADVERTISER", direction = Relationship.OUTGOING)
private User user;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof IdentifiableEntity)) return false;
IdentifiableEntity entity = (IdentifiableEntity) o;
if (!super.equals(o)) return false;
if (id != null) {
if (!id.equals(entity.id)) return false;
} else {
if (entity.id …Run Code Online (Sandbox Code Playgroud)