Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-07-2018 09:50 AM
OGM (v3.1.1) doesn't seem to support @NodeEntity
on an interface class with the label specified explicitly. Let's say, I have an annotated interface:
@NodeEntity(label = "MY_LABEL")
interface MyInterface { ... }
which is implemented by a class MyInterfaceImpl
. Now, I can't make OGM map the entity names in the db result (MY_LABEL
) to the corresponding java class (MyInterfaceImpl
) - there seems to be no mapping "label => interface => implementing class". However, it does work as expected when the label is identical to the interface name.
Am I missing something?
09-07-2018 05:10 PM
Interesting. Have you tried putting the @NodeEntity annotation on the implementation class?
09-10-2018 06:31 AM
Thanks, @Jiropole, I did some further research, and indeed:
@NodeEntity(label="...")
has to be set on the implementation class.@NodeEntity
(without label=...
) needs to be on the interface, otherwise no mapping is found (see https://github.com/neo4j/neo4j-ogm/issues/458).Not quite self-explaining, I couldn't find any documentation about this, though.
All the sessions of the conference are now available online