Hi,

I have an abstract class "OrganisationNode" containing a "@GraphId id" 
field.

I have several concrete classes extending OrganisationNode, for example 
"InstitutionNode" or "CommunityNode". None of them have a @GraphId field. 
If I put another "@GraphId id" field on InstitutionNode, I get the 
following error "Attempt to add id property private java.lang.Long 
eu.ueb.acem.domain.beans.rouge.neo4j.OrganisationNode.id but already have 
property private java.lang.Long 
eu.ueb.acem.domain.beans.rouge.neo4j.InstitutionNode.id registered as id. 
Check your mapping configuration!"

However, this seems ok at first, because each of my DAOs (e.g. 
InstitutionDAO, CommunityDAO, etc) contain a CrudRepository instance 
specific to a given concrete class. It can create nodes and they have the 
good labels, e.g. if I call InstitutionRepository.create("my new 
institution"), the resulting node will have the labels : "Organisation", 
"Institution" and "_Institution". That's exactly what I want.

The problem is that CrudRepository#exists returns true, even if I mix the 
concrete classes. For example, if I call InstitutionRepository#exists(id of 
a CommunityNode), it returns true! The same thing happens with 
CommunityRepository#exists(id of an InstitutionNode).

It seems that the @GraphId concerns the OrganisationNode and that the 
"exists" method doesn't care about the type associated with the 
CrudRepository. I would find logical the following results :
- InstitutionRepository#exists(id of a InstitutionNode) to return true
- InstitutionRepository#exists(id of a CommunityNode) to return false

Is that a bug? Or is that how it is supposed to work, and should I 
overwrite the "exists" method?

Thanks!

Grégoire

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to