Thanks for that explanation, I thought it wouldn't be as simple as it
"could" be.

Philip

On 5/4/08, Emil Eifrem <[EMAIL PROTECTED]> wrote:
> Hi Philip,
>
>  So from a Java perspective, your two Enums are definitely different
>  types and there's no interoperability between them whatsoever. But Neo
>  ignores that. For Neo, the *name* of a relationship type (as defined
>  by the Stirng name() method in the RelationshipType interface) is the
>  unique identifier of a relationship type. From the API spec:
>
>    "The name uniquely identifies a relationship type, i.e. two
>  different RelationshipType implementations with different object
>  identifies (and possibly even different classes) are semantically
>  equivalent if they have equal names."
>
>    
> (http://api.neo4j.org/current/org/neo4j/api/core/RelationshipType.html#name())
>
>  We chose this -- despite some drawbacks, like potential confusion in
>  equals() comparisons [see javadocs for elaboration] -- so that it
>  would be easy to refactor relationship type enums for example as
>  outlined in your mail.
>
>  Btw, the reason you don't usually think of the name() method of a
>  RelationshipType is that it's implicitly defined by the Enum class
>  (it's actually synthesized by the Java5 compiler to return the name of
>  the constant field in your enum). That's why it's neat to define
>  reltypes through enums.
>
>  So the short answer is: Neo will treat
>  MyRelationshipTypes.CONTAINED_IN as an equal() and same type as
>  MomsRelationshipTypes.CONTAINED_IN.
>
>  Hope that helps!
>
>  Cheers,
>
>
>  --
>  Emil Eifrém, CEO [EMAIL PROTECTED]
>  Neo Technology, www.neotechnology.com
>  Cell: +46 733 462 271 | US: 206 403 8808
>  _______________________________________________
>  Neo mailing list
>  User@lists.neo4j.org
>  https://lists.neo4j.org/mailman/listinfo/user
>
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to