openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: does openjpa support cascade-persist via a persistence-unit-defaults mapping?
Date Tue, 24 Jun 2008 19:36:33 GMT

Hi Craig,
   'persist' is already there. 'merge' (and may be 'refresh') sounds good
too. 
Agree that 'delete'/'all' will be dangerous :)
    The user should also be able to qualify the default cascade behavior per
mapping type i.e. one-to-one, one-to-many etc.
 



Craig L Russell wrote:
> 
> Default cascade merge and persist seem like good things.
> 
> Default cascade delete (you didn't mention it here, but for  
> completeness) seems wrong.
> 
> Craig
> 
> On Jun 24, 2008, at 11:05 AM, Pinaki Poddar wrote:
> 
>>
>> Hi,
>>  Default cascade behavior looks like a useful feature. What do others
>> think?
>>
>>  Cascade operations currently are not defaulted.
>>
>>  But like many other behavior in OpenJPA, such behavior can be  
>> plugged-in.
>>
>>  Here is a small class attached to do just that.
>>
>>  To activate it, you need to configure persistence.xml as
>>    <property name="openjpa.MetaDataFactory"
>> value="cascade.CascadeMappingFactory(cascade='persist,merge')"/>
>>
>>   This will, by default, add 'PERSIST" and 'MERGE' to all  
>> relationships.
>> You can specify any of the valid CasacdeType enum values in a
>> comma-separated list in 'cascade'  attribute
>>
>> http://www.nabble.com/file/p18096612/CascadeMappingFactory.class
>> CascadeMappingFactory.class
>> http://www.nabble.com/file/p18096612/CascadeMappingFactory.java
>> CascadeMappingFactory.java
>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/openjpa---DBCP-tp17991707p18096612.html
>> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>>
> 
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell@sun.com
> P.S. A good JDO? O, Gasp!
> 
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/openjpa---DBCP-tp17991707p18098387.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message