Question

I'm writing an application that uses JPA for persistence. Currently I'm testing with Hibernate and a MySQL database. The server it's going to be deployed on already has ZODB running though. To avoid having to install MySQL especially for this app, it would be nice to use ZODB as the backend for JPA. Is this possible, with or without Hibernate?

Was it helpful?

Solution

Do you mean ZODB as in Zope Object Database? If so the answer is no. JPA is all about ORM (Object Relational Mapping), meaning your are working with relational databases. ZODB is a object database which is completely different thing. Why would you use JPA if you are going to use a object database?

OTHER TIPS

No, the ZODB is a python-specific object database. It uses Python-specific tricks to load and store object state, something the JPA cannot provide (it is designed to map objects to relational databases).

No current implementation for persisting to ZOPE DB but you could add support for persisting it using JPA via DataNucleus by adding support for that DB. Sounds complicated but the basics is using doable in a couple of days ... as per http://www.datanucleus.org/servlet/wiki/display/ENG/HOWTO+Support+a+new+datastore DataNucleus already supports other object datastores via JPA (db4o, NeoDatis) hence why it ought to be doable

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top