Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » convert mapping source to mapping XML(convert mapping source to mapping XML)
convert mapping source to mapping XML [message #1467089] Sun, 09 November 2014 20:13 Go to next message
raj s is currently offline raj sFriend
Messages: 2
Registered: April 2012
Junior Member

The project I am working on is migrated from the legacy toplink 4.3 to Eclipselink.
The mapping (similar to orm.xml) in legacy Toplink had an XML version and a Java version. Both were, then automatically generated by the Toplink workbench. In the last many years, we lost the XML version. We don't have the Toplink workbench and the XMLs. The developers directly entered code in the mapping java source. The direct edit of the toplink generated code resulted in errors in the cascade delete. Especially around tables that had aggregate mapping.

I am looking to reverse engineer the mapping source file to XML descriptors using the new Eclipselink workbench. I expected an automatic conversion of mapping source to XML descriptors. I felt this process would show us the incorrect mapping. But the new workbench does not seem to have a feature to reverse the java code to XML descriptors.

May I know how we could return to the good practices of Eclipselink and how I could validate the mapping for possible errors.

Re: convert mapping source to mapping XML [message #1469970 is a reply to message #1467089] Wed, 12 November 2014 02:07 Go to previous message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
When dealing with the TopLink mapping workbench and talking about XML files, there are two possibilities that you could be referring to. The first are the set of XML files associated to the mapping workbench project itself. These are the files the workbench used and contained all the metadata needed by the workbench for its features such as entity generation, table generation etc. The workbench files contained quite a bit of information, and from it the workbench would generate a TopLink mapping file - either a project.xml or class. This project.xml/project class would be used by TopLink runtime and would contain only the metadata required to map your java objects to the database. This process of creating a project file was unfortunately only one way as far as I am aware, so if you no longer have the original workbench project files, you might have to start over or continue to use the project java source with EclipseLink - if you start over, I would recommend using a tool such as Eclipse's Dali project and use the JPA interface, as it is easier to get started and still use EclipseLink/TopLink advanced features.

That said, the best way to validate is to load the session with logging enabled and check for warnings in the logs, and try to use your project by unit testing some crud operations and queries. The biggest problem with projects though is unexpected behavior, and validation is not likely to pick that up because it cannot determine what the developer intended, only what the settings tell it should be done. If you are having specific problems, you might try Oracle support as they might have experience with project files and know quickly what to look for. You might also try narrowing down the problem and posting as much as possible here.

Hope it helps,
Previous Topic:Eclipselink merge does not insert a new row in many-to-many relationship
Next Topic:EclipseLink and WebSphere 8
Goto Forum:

Current Time: Tue Feb 27 21:42:35 GMT 2024

Powered by FUDForum. Page generated in 0.02400 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top