Hi, 

I noted in playing with spring-data-neo4j that the Node's under neo4j Don't
have an ID key like typically we would in an RDBMS scenario.

My use case, in short is the application I will be building out will have, a
really simple Web Interface with REST type URLs. So .. for example, I will
be able to do

http://myservice.co.uk/superwebapp/mySpecialThing/detailedView/55

The 55 there will result in a query to Neo4J to locate the "MySpecialThing"
object with ID of type 55 and display it.

So to ensure I have a "per concrete domain POJO, a set ID", I created a
simple ID manager setup.

The thought (for the alpha version) is, that on invoking "getId()" for the
object, an aspect wrapper around it looks to see if it has an id (if it's
null) and if not, it goes and creates an ID from a singleton bean manager,
which in turn loads from neo4j Or looks into a cache, for an
IdObject(ClassName) which has getNextId() on it.

It's not beautiful but practical. The unit tests work all good.

I considered using a UUID as the ID, but I know you do get to use the
simpler "numbers" practically more. I did not want to use NodeId as these
are repository wide. 

Any thoughts ? 

My one thought is that the getId() Aspect probably should be on persist() or
somewhere deeper. Such that the id is actually created on storage. (conjures
up needs to check the Id for clashes etc .. ewww).

you will find the post over at 

http://rbtech.blogspot.com with the suitable code.



--
View this message in context: 
http://neo4j-community-discussions.438527.n3.nabble.com/Primary-Like-ID-Across-Class-Types-tp3457270p3457270.html
Sent from the Neo4j Community Discussions mailing list archive at Nabble.com.
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to