2010/12/6 Caron Zhao <caron.z...@gmail.com>

> Hi,
>
>               I know graphDb.createNode() can create a new Node and store
> it into db, I want to know if I have already had a Node, how can I add this
> Node to db? It seems that the code
>

In what scenario would you "have" a Node which weren't stored in the db?
Nodes are created inside a transaction and if that transaction committs the
node is stored in the db.


>
> indexService.index( node, partIndexName, value )  can add node to db, but I
> may don't need specify the index as I can specify the index by annotation
> declaration in a POJO.
>
> IndexService is the old index API, look at the integrated index 
> API<http://wiki.neo4j.org/content/Index_Framework>instead. Associating a 
> key/value pair with a Node in an index doesn't add
that node to the database, it just adds that key/value pair to the index and
associates it with the given Node. The nodes already exist in the database
by that time (or were created in the same transaction that you're currently
in).

Are you writing your own layer in top of Neo4j with @Annotations? Have you
looked at jo4neo <http://code.google.com/p/jo4neo/>?

>
>
> Regards,
>
> Caron
>
>
>
>
>
> _______________________________________________
> Neo4j mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to