Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-21-2022 01:04 AM
@Node("Person")
@Data
public class PersonEntity {
@Id
@GeneratedValue
private Long id;
@Property(name = "name")
private final String name;
@Property(name = "born")
private final Integer born;
@Relationship(type = "FRIEND", direction = OUTGOING)
private Set<PersonEntity> actors = new HashSet<>();
public PersonEntity(Integer born, String name) {
this.born = born;
this.name = name;
}
//Getters omitted
}
I want to define the person entity with relationship "FRIEND".
But if I put the relationship into th person entity, it causes infinite loop.
I just want to query a person and it`s friends using the entity.
09-27-2022 01:07 AM
Do you have a reproducer? This should not fail from the Spring Data Neo4j side, _but_ it might be Lombok that is messing with the equals and hashCode implementation via the _Data_ annotation and includes the PersonEntities of the map. If those are the same, it will end up in an infinite loop.
All the sessions of the conference are now available online