Closed meistermeier closed 4 years ago
Discussion about label inheritance on the community site: https://community.neo4j.com/t/inheritance-in-sdn-rx/14916/2
The downside of this approach would be to introduce a (more complex) hierarchy scanning.
An entity does not need to have a @Node
annotation to get mapped later in the process and its label will get derived from its class name.
Assuming we would have a constellation like this:
@Node("baseLabel")
class BaseClass {}
class User extends BaseClass {}
should this fail? I would say no but with only baseLabel it is not possible to find out what the target entity is for loading.
Suggestion: No @Node
in parent classes allowed. So if at least one extending class exists, the application will not start.
We will remove the @Inherited
attribute on the @Node
annotation and log a warning if a user relies on inheritance for multi label.
Reminder: Multi labels can only be used by defining them on the most concrete class.
We decided to move into the opposite direction and allow the reflection of inheritance in the Java domain model to the database. This issue is closed by #165
There should be a check in place during initialization to look for "inherited"
@Node
annotations. If this is the case it should throw a matching exception and not start the application at all.