cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Persisting Generic RelationshipEntities

Hey

I have an a RelationshipEntity that I want to persist, however I get a NullPointerExcpetion in the OGM . The special thing about the Entity is that it is a Generic meaning RelName extends Persistable {}. When the construct to persist is a List of these objects it works, however when I have a simple field of this relationship I get the following error:

java.lang.NullPointerException
at org.neo4j.ogm.context.EntityGraphMapper.mapEntityReferences(EntityGraphMapper.java:428)
at org.neo4j.ogm.context.EntityGraphMapper.mapEntity(EntityGraphMapper.java:282)
at org.neo4j.ogm.context.EntityGraphMapper.map(EntityGraphMapper.java:170)
at org.neo4j.ogm.session.delegates.SaveDelegate.lambda$save$1(SaveDelegate.java:89)
at java.base/java.util.Collections$SingletonList.forEach(Collections.java:4856)
at org.neo4j.ogm.session.delegates.SaveDelegate.save(SaveDelegate.java:89)
at org.neo4j.ogm.session.Neo4jSession.save(Neo4jSession.java:485)

Are Generic Entities somehow supported, am I missing something or is this a known problem that a workaround exists for? I thought maybe one could write a custom converter?

0 REPLIES 0
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online