[Design of EJB 3.0] - JPA delete problem on @OneToMany: deleted entity passed to p
by kolumbien81
I'm doing an relationship with two Entity (Parent - Child). So, in
Parent class I had a collection of Child. When I remove one item (child)
from the collection, its appears ok. But in database the operation doesn't
happen. I'd tried to remove by em.remove(child) , but this error occur: "
org.hibernate.ObjectDeletedException: deleted entity passed to persist: [
model.Child#]"
It happens because in the parent I have the CASCADE.PERSIST on the Children Set like this
@OneToMany (fetch = EAGER, cascade=CascadeType.ALL)
| public Set<Child> getChildren()
so if I remove the CASCADE.PERSIST, leaving it like this:
@OneToMany(cascade={CascadeType.MERGE, CascadeType.REFRESH, CascadeType.REMOVE)
| public Set<Child> getChildren()
It works perfect but when I am going to create the child, it doesn't create the child, so I am feeling like in a dead lock.
Someone can help me?
Thanks a lot
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4216098#4216098
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4216098
17 years, 1 month
[Design of JBoss ESB] - Enhancement to XPathLanguage.dsl
by kurtstam
I noticed the new DslHelper, very nice Daniel. This inspired me to propose the following addition to the XPathLanguage.dsl
Add:
[then]SetAsString : "{key}", "{xpath}"=msg.getBody().add("{key}",org.jboss.internal.soa.esb.services.routing.cbr.DslHelper.selectAsString(msg, "{xpath}") );
This will allow the user to write rules that can extract some fields from the XML and set them as named parameters on the Message.Body.
For example the rule:
| when
| xpathGreaterThan "/price", "1.00"
| then
| Log : "XPath Greater Then";
| Destination : "XML_XPath_GreaterThan_Destination";
| SetAsString : "priceInDollars", "/price";
|
would add the named parameter "priceInDollars" to the ESBMessage with a value of "1.00"
I guess you can also consider adding SetAsNumber etc.
Cheers,
--Kurt
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4216024#4216024
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4216024
17 years, 1 month