Wolfgang-Schuetzelhofer / jcypher

Java access to Neo4J graph databases at multiple levels of abstraction
Apache License 2.0
86 stars 15 forks source link

How to execute string queries #48

Closed jcornaz closed 5 years ago

jcornaz commented 5 years ago

Hi,

I like very much the IDbAccess interface which may be backed by an embedded, a remote or an in memory database.

But is there a way to execute plain cypher string instead of using the cypher DSL?

Wolfgang-Schuetzelhofer commented 5 years ago

Hi, For cypher statements which are not or not yet supported in JCypher, or if you just want to write plain cypher, you can always use JCypher's NATIVE clause. By means of the NATIVE clause you can write parts of a query or even an entire query in cypher. For an example please see below:

clauses = new IClause[]{
  ...,
  ...,
  NATIVE.cypher("RETURN DISTINCT ....")
};

The NATIVE clause can take one or more lines of plain cypher.

Best regards, Wolfgang

jcornaz commented 5 years ago

Great. Thanks.