I'm actually not using the orm.xml at all... i only have a persistence.xml
for the connection but I'm one of those that will remove all xml from the
configuration if I can (I don't like that I have passwords in my svn repo :)
and have been thinking bout trying to manually configure the manager just to
remove it.

I was concerned that the cascade persist would end up writing a new Role
record so I had it turned off (by wording, thats what I'd expect) and I have
it set in annotations anyway.

Anyway, I'll do a bit more reading and see if I can find something useful
about it. Thanks for your help.

- Brill


Patrick Linskey-2 wrote:
> 
>> No doubt this is by design, but I think the framework could be a bit
>> smarter
>> about it... if the referenced class has not changed (and particularly in
>> a
>> many/many relation where there is a third table) the relationship should
>> simply be persisted (governed by what ever constraints are already on the
>> reference table).
> 
> This is basically what the cascade setting for relationships are there
> for. I believe that the current JPA spec default is broken; I think
> that cascade-persist and probably cascade-merge should be enabled by
> default. However, that's not what the spec says, hence our behavior.
> 
> Note that there is a global toggle in orm.xml to turn on
> cascade-persist by default for all relationships.
> [...]
> 

-- 
View this message in context: 
http://www.nabble.com/Help%3A-Attaching-an-already-persisted-object-to-a-new-parent.-tf4776024.html#a13678728
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to