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...
@Entity(name = "PERSON")
public abstract class Person {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE,
generator = "personIdGenerator")
@SequenceGenerator(name = "personIdGenerator",
sequenceName = "personSequence",
initialValue = 1,
allocationSize = 1)
@Column(name = "Id")
private Long id;
@Column(name = "Name")
private String name;
}
@Entity(name = "PLAYER")
public class Player extends Person {
}
... 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:
"MATCH (n:PLAYER) RETURN n"
Instead I have to write it like this...
"MATCH (n) WHERE n.DTYPE='PLAYER' RETURN n"
...which feels strange. |