RelationshipType is just an interface with the "name()" method.

RelationshipType knows = DynamicRelationshipType.withName("knows");

node.createRelationshipTo(node2,knows);

Michael

P.S. You can also imagine other programmatic ways of implementing that 
interface.

Am 08.07.2011 um 01:13 schrieb noppanit:

> But I can have an enum class and implements RelationshipType but doesn't that
> mean that I have to define each Relationship before hand. For example, If I
> have a text, "I know john", and "know" relationship doesn't exist in
> MyRelationshipType (which implements RelationshipType already). How could I
> create that in runtime? I think when I want to createRelationship I have to
> specific RelationshipType?
> 
> Thank you very much,
> 
> --
> View this message in context: 
> http://neo4j-user-list.438527.n3.nabble.com/Add-relationships-dynamically-tp3149437p3149985.html
> Sent from the Neo4J User List mailing list archive at Nabble.com.
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user

_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to