Object Mapping for neo4j in Java EE with JPA

381 views Asked by At

I was wondering if I could use the libraries from org.springframework.data.graph as a JPA Persistence Provider in Java EE. I haven't tried this yet, but was wondering if it is even reasonable to expect this to work in Java EE, or if the JPA implementations would only work with Spring.

I'm just getting started with neo4j and have done some basic things using the neo4j JDBC Driver with some Cypher statements, but am looking for a way to use neo4j in Java EE the same way I would with a relational store like MySQL.

1

There are 1 answers

0
digx1 On

While JPA provides a great abstraction layer for relational databases when it was devised, it doesn't quite have the flexibility to abstract NoSQL databases.

If you want a JPA/Hibernate like experience though the Neo4J OGM might be the thing you want. You can check out the documentation here too.

That said, if you use a Spring container then you may want to check out Spring Data Neo4J (Version 4.2.0.RELEASE is going to be out in a couple of weeks), which wraps the OGM and provides developers with concepts found in Spring Data.

The Neo4J JDBC driver is meant to be more of a crutch to help developers connect to Neo4J over JDBC. I wouldn't recommend building any production type applications on it.