Hi Victor,

Sorry for the late reply.

On Fri, Nov 28, 2008 at 7:20 PM, Victor Volle <[EMAIL PROTECTED]> wrote:
> sounds great. The only thing is that you need a NeoService to create a node.
> Or you must somehow detect (?) an existing NeoService.

Good question, I don't really know the Neo4J APIs, so I don't really
know yet :-)

> I am not sure, what would be necessary to transform:
>
>   neo.createNode()
>
> into
>
>  def firstNode [:]
>
> somehow the neo (the NeoService instance) needs to be 'injected'
>
> Any ideas?

At first sight, if we can define our own type coercion, we could put
some logic in there.
That said, the coercion logic would probably be on the Map side, and
it's already overloaded in Groovy, so it may not be the best idea to
override it again.

So perhaps the best would be to just add a new createNode method that
would take a map:

def firstNode = neo.createNode( [name: "Neo"] )

-- 
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one
_______________________________________________
Neo mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to