Migrating Toplink CMP to TopLink/EclipseLink JPA [message #521727] |
Thu, 18 March 2010 11:25  |
Eclipse User |
|
|
|
Hello,
I'm currently converting a project from Weblogic 8 using EJB 2.1 CMPs to Weblogic 10.0 using EJB 3.0 and JPA for persistence storage.
I have already changed all entities in the Toplink mapping workbench to Java POJOs and generated the appropriate entity classes. I then created the mapping file from the workbench (tried Toplink and EclipseLink Workbench) and tried to incorporate them into Weblogic 10.0 using a persistence.xml.
I have not generated a project file and included it. As far as I understand it this is not necessary when using toplink/eclipselink as a JPA provider.
The server starts up and I can obtain a EntityManager but as soon as I try to do a simple findByPrimaryKey search I get the notice that the entity is unknown.
To ease migration we do not want to use Annotation but the generated mapping file. But it seems that EclipseLink is not even reading the file.
For testing purposes I changed one of the entities to using annotations and voila EclipseLink finds the entity and initializes it and I can do a findByPrimaryKey on it but the documentation states that it should be enough to specify the mapping file.
My persistence.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="punit" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider >
<!--provider>org.eclipse.persistence.jpa.PersistenceProvider </provider-->
<jta-data-source>JTAsrc</jta-data-source>
<non-jta-data-source>nonJTASrc</non-jta-data-source>
<properties>
<!-- properties to fine tune logging -->
<property name="eclipselink.target-server" value="WebLogic_10"/>
<property name="eclipselink.logging.level" value="FINEST"/>
<property name="eclipselink.logging.timestamp" value="false"/>
<property name="eclipselink.logging.thread" value="false"/>
<property name="eclipselink.logging.session" value="false"/>
</properties>
</persistence-unit>
</persistence>
I also tried to specify a standard jpa orm.xml and I see Eclipselink configuring the entities just as when I used annotations. It just doesn't load the mappings that are specified in the workbench mapping file.
Can anybody help me out or point me to some resource where a migration from cmp to jpa is documented in the context of weblogic and toplink/eclipselink?
Many thanks
-Stefan
|
|
|
|
Powered by
FUDForum. Page generated in 0.03176 seconds