Note that this is available within the JPA spec via the orm.xml's persistence-unit-defaults section.

I'd rather see this configuration setting get promoted into JPA2's persistence.xml instead of introducing a new setting of our own.

(In fact, I'd rather see cascade-persist at least be turned on by default across the board. I've never understood the desirability of disabling cascade-persist, and have never gotten a straight answer from anyone about it.)

-Patrick

On Jun 24, 2008, at 11:17 AM, 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:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!


--
Patrick Linskey
202 669 5907

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to