Any way to use JPA and JDO together easily?
ebenzacar@...
As I am migrating my legacy Kodo based application to DataNucleus, I noticed that the application uses both JDO for most persistence based interaction, however has several JPQL queries which leverage a JPA Entity Manager. The app leverages OpenJPA's `JPAFacadeHelper.toEntityManager()` to create a JPA entity manager from Kodo's persistence manager. My application exclusively uses a RDBMS store (MSSQL to be specific). Eric |
|
Perhaps you would be better off looking at the DataNucleus (and JDO) documentation.
The JDO spec mandates being able to use JPA metadata (XML / annotations) with JDO persistence, and DataNucleus (JPA) also allows use of JDO metadata (XML / annotations) with JPA persistence. DataNucleus seemingly allows use of JPQL with the JDO API (without the need to create any EntityManagerFactory), though not sure what query needs JPQL for that JDOQL can't express. A query language like JPQL is in core code and hence available to both APIs. Kodo doesn't seem to be as flexible as that ;-) |
|
ebenzacar@...
Thanks; I hadn't seen that extension.
I see that the the JDO pm allows for using JPQL but remaining within the JDO framework. Which from a consistency perspective is great. However, from a "retrofit" perspective, I still have the problem of my legacy code using all javax.persistence constructs and classes. But hopefully shouldn't be too bad - I see many of the javax.jdo.Query methods are analogous to the javax.persistence.Query methods. I will post as I continue the efforts if I have additional JPQL questions/issues. So far, a quick test has yielded great results. |
|