neo4j - simple relationsships vi RelationshipType
The imdb example uses the code
[code]
package org.neo4j.examples.imdb.domain;
import org.neo4j.graphdb.RelationshipType;
public enum RelTypes implements RelationshipType {
ACTS_IN, IMDB
}
[code]
The Movie class then uses a string to define the relationship type
[code]
@NodeEntity
public class Movie {
@Indexed
String title;
int year;
@RelatedTo(type = "ACTS_IN", elementClass = Actor.class, direction = Direction.INCOMING)
Set<Actor> actors;
[code]
Is there a reason why type could not be a RelationShipType as well as a string for simple types?
ex
[code]
@NodeEntity
public class Movie {
@Indexed
String title;
int year;
@RelatedTo(type = RelTypes.ACTS_IN, elementClass = Actor.class, direction = Direction.INCOMING)
Set<Actor> actors;
[code]
I like to avoid strings so the compiler can help point out my typos, it would be nice not to have to maintain a string enum and an RelationshipType.
This may be possible today, am I missing something (definitely possible...)
Thanks
Mike.
PS I think I need the RelationshipType to use the graph traverser
http://wiki.neo4j.org/content/Traversal_Framework
The greatest performance improvement is the transition from a non-working state to the working state...