Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » mappingworkbench private owned vs. cascadetype ?
mappingworkbench private owned vs. cascadetype ? [message #384236] Tue, 09 December 2008 08:34 Go to next message
Wolfgang  is currently offline Wolfgang
Messages: 10
Registered: July 2009
Junior Member
In previous toplink versions (9.04 and older)private owned relationships
would tell a unitofwork to insert owned objects together with an owned
object.

Apparently Eclipselink does not work this way in JPA on glassfish v2 - a
"private owned" one-to-one mapping from owner to owned does not cause the
EntityManager to persist a new owned object when em.persist(owner) is
called.

With setting mapping.cascadeAll(true) programmatically at least a
unitofwork obtained via
EntityManager.delegate.activeSession.acquireUnitOfWork will insert the
owned object when the owner is registered and the uow is committed.

But the mapping workbench does not support the setting of cascade-type.

Do I have to use annotations, programmatical changes, ... or is there a
better way to use eclipselink with the mapping workbench for ownership
relations with JPA-SunAS9?
Re: mappingworkbench private owned vs. cascadetype ? [message #384237 is a reply to message #384236] Tue, 09 December 2008 09:13 Go to previous messageGo to next message
Wolfgang  is currently offline Wolfgang
Messages: 10
Registered: July 2009
Junior Member
Wolfgang wrote:

> In previous toplink versions (9.04 and older)private owned relationships
> would tell a unitofwork to insert owned objects together with an owned
> object...
typo in first sentence - should be
... insert owned objects together with an "owner" object.
Re: mappingworkbench private owned vs. cascadetype ? [message #384240 is a reply to message #384236] Tue, 09 December 2008 15:05 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You can use an amendment method from the Mapping Workbench to set the
mapping's cascade. You could also use a SessionCustomizer to iterate over
all the descriptors for the session and set cascade all for any private
owned mapping.

In general the Mapping Workbench is meant for the native API, not for JPA.
For JPA you can use annotations, orm.xml, or JPA UI's such as Eclipse
Dali.

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Re: mappingworkbench private owned vs. cascadetype ? [message #384243 is a reply to message #384240] Wed, 10 December 2008 13:04 Go to previous messageGo to next message
Wolfgang  is currently offline Wolfgang
Messages: 10
Registered: July 2009
Junior Member
well, I like the mapping workbench with its round-trip capabilies for both
object model and database. Actually I was quite happy that we could have
the MWB's project.xml and sessions.xml with JPA. A single amendment method
or SessionCustomizer would not stop me ;-)

But if it is not meant/recommended then we will not use the MWB for a new
project and rather use Eclipse Dali or similar.
Any plans to have the MWB support JPA?

Wolfgang
Re: mappingworkbench private owned vs. cascadetype ? [message #384361 is a reply to message #384243] Fri, 19 December 2008 16:22 Go to previous message
Doug Clarke is currently offline Doug Clarke
Messages: 155
Registered: July 2009
Senior Member
Wolfgang,

It is actually the same development team from the Workbench who is
building Dali. The Workbench provides a great solution for mapping classes
based on their byte-codes but with JPA and JAXB providing mapping
capabilities using annotations it becomes very difficult to have the
workbench modify source without effectively building an IDE.

Our goal is to continue to enhance Dali to deliver all the standard JPA
mapping features you need while also providing EclipseLink specific
extensions to leverage advanced features. Dali does provide support for
generating a JPA entity model from the schema and will soon support the
eclipselink-orm.xml mapping file with our advanced features.

The Dali newsgroup is available here if you wish to give feedback directly
to the development team:

http://www.eclipse.org/newsportal/thread.php?group=eclipse.t echnology.dali

and the features for the next Dali release are described here:

http://wiki.eclipse.org/Dali_2.1Planning

If there are features in the workbench you want to see in Dali please let
us know.

Doug
Previous Topic:Why should I upgrade?
Next Topic:in memory rollback
Goto Forum:
  


Current Time: Wed Oct 22 21:54:35 GMT 2014

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

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