Suggest returning to domain object by Cypher Query Language adding NEW key words

24 views
Skip to first unread message

杨军

unread,
Nov 23, 2012, 2:23:31 AM11/23/12
to ne...@googlegroups.com
When using the NE04J data base, modeling the domain object under embedded model always uses  
public class DomainModel {
          protected final Node underlyingNode;
          public DomainModel( final Node underlyingNode ) {
                    this. underlyingNode = underlyingNode;
          }
...
}

When using Cypher Query Language, RETUEN can return to DomainMOdel object directly through NEW key words
For example:

START john=node:node_auto_index(name = 'John')
MATCH john-[:friend]->()-[:friend]->fof
RETURN new DomainModel(john) , fof


--
Best regards,
yang jun
Tel: 028-85126877
Mob: 18608027881 <mailto:yangjun...@gmail.com>
Chat: yangjun...@gmail.com(gtalk)

杨军

unread,
Nov 23, 2012, 2:25:09 AM11/23/12
to ne...@googlegroups.com
When using the NEO4J data base, modeling the domain object under embedded model always uses  
public class DomainModel {
          protected final Node underlyingNode;
          public DomainModel( final Node underlyingNode ) {
                    this. underlyingNode = underlyingNode;
          }
...
}

When using Cypher Query Language, RETUEN can return to DomainMOdel object directly through NEW key words
For example:

START john=node:node_auto_index(name = 'John')
MATCH john-[:friend]->()-[:friend]->fof
RETURN new DomainModel(john) , fof


2012/11/23 杨军 <yangjun...@gmail.com>

Michael Hunger

unread,
Nov 23, 2012, 2:27:55 AM11/23/12
to ne...@googlegroups.com
I think this mixes two concerns,

cypher returns the data from the database much like SQL,

you would use a mapping framework to convert them into objects, e.g. Spring Data Neo4j, Spring and the JDBC Driver or something like the DataNucleus bindings

Michael

--
 
 

Josh Adell

unread,
Nov 23, 2012, 11:00:48 AM11/23/12
to ne...@googlegroups.com
How would this be handled in a non-embedded sense, over the REST API?

-- Josh
Reply all
Reply to author
Forward
0 new messages