I'm modeling my first Spring Data Neo4j app and am wondering about subclassing @RelationshipEntity classes- 1) can it be done, and 2) is it a good idea?
Here's an example of what I'm thinking of using RSS.
A Feed
has many Entry
s and there are 3 types of entry:
- Original entry (new content)
- Reblogged content
- Liked content (effectively a degenerate Reblog)
A Feed could look like this:
@Relationship
List<Entry> entries;
where Liked is a subclass of Reblog which is a subclass of Entry.
This seems more natural given RelationshipEntities are first class objects:
@Relationship(type="Content", Relationship.OUTGOING)
List<Entry> entries;
...
@RelationshipEntity(type="Content")
public class Content {
...
@RelationshipEntity(type="RebloggedContent")
public class RebloggedContent extends Content {
...
@RelationshipEntity(type="LikedContent")
public class LikedContent extends Content {
...
As I said, this is my first Neo4j app so I don't know if any of these ideas are any good.
From a query point of view I want to be ask questions about both particular types (or combinations of types) of Entry
and Entry
s as a whole.
Pointers to design/modeling ideas are appreciated.