Enhance working with inherited entities by using multiple Labels

Description

At the moment if you use an inheritance structure within your entity classes the nodes are not created correctly from my point of view.

If I model a structure like this...

... Hibernate-Ogm generates a Node with the Labels ENTITY and PERSON. Furthermore it gets the properties Id, Name and DTYPE. The DTYPE is then the name of the concrete subclass.
From my point of view I would expect a Node with the Labels ENTITY, PERSON and PLAYER or ENTITY and PLAYER. I'm note absolutly sure what's the correct solution here but it feels strange not to be able to query my node like this:

Instead I have to write it like this...

...which feels strange.

Environment

None

Activity

Show:
Davide D'Alto
November 14, 2016, 12:12 PM

Thanks , that's a good point

Davide D'Alto
November 14, 2016, 12:14 PM

I think it make sense to have multiple labels in this case:

You should be able to execute both queries:

Davide D'Alto
November 16, 2016, 12:36 PM

For your use case, if it is enough to have the node mapped as ENTITY and PLAYER you can use the annotation @Inheritance(strategy=TABLE_PER_CLASS)

Assignee

Davide D'Alto

Reporter

RichardK

Labels

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

Priority

Major
Configure