I?m using CMP entity beans. I have an entity HistoricoEstudo whose primary key 
is auto-increment. I have a relationship many-to-many between this entity 
HistoricoEstudo and Pessoa.  I have configured jboss.xml with 
<insert-after-ejb-post-create>true</insert-after-ejb-post-create> for entity 
HistoricoEstudo, so the insert is executed only after all relationships are set 
on ejbPostCreate.

When I try to create a new entity HistoricoEstudo I get an error because the 
container tries to use the value 0 (not the value resulted from the 
auto-increment) as the foreign key for the relationship HistoricoEstudo-Pessoa. 

If I make <insert-after-ejb-post-create>false</insert-after-ejb-post-create> 
the value used as the foreign key in the many-to-many relation is the one 
resulted from auto-increment, but then the not null constraints are violated, 
since the object is inserted before the other relations are set on 
ejbPostCreate.

Does anybody know how to solve this problem?

Juliana


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3955608#3955608

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3955608

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to