This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes cmp EJB problem with JBoss3.x Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "cmp EJB problem with JBoss3.x" Watch "cmp EJB problem with JBoss3.x" New topic
Author

cmp EJB problem with JBoss3.x

Ron Chan
Greenhorn

Joined: Nov 08, 2001
Posts: 11
i have two tables in db,the pk of the first table is not only one of pks of the second table,but also the fk of the his!
now,i set the relationship using fk-mapping,but when i insert a record in the second table,the error will show "duplicate column,can't create entity bean etc."
how to resolv this problem? it's the jboss's constrain?
Volodymyr Shram
Ranch Hand

Joined: Oct 17, 2002
Posts: 47
Originally posted by Ron Chan: i have two tables in db,the pk of the first table is not only one of pks of the second table,but also the fk of the his! now,i set the relationship using fk-mapping,but when i insert a record in the second table,the error will show "duplicate column,can't create entity bean etc." how to resolv this problem? it's the jboss's constrain?

Hi, Ron.
You know, I had the same problem with my jboss cmr-fields . Look here to know how I solved this problem:
http://forum.java.sun.com/thread.jsp?forum=13&thread=285846
When you need insert your PK in Entity-bean, you shoud make this inserting in PostCreate method. I have to say, that it is not very good way to use cmr when your system has many inserts/updates, and as result, I refused to use cmr in my system, and have to say, that my choise was very smart -- I use entity-beans for table-mapping only, and all relationships I represent in my models (one model for one table) .
Refusing to use cmr will simplify your development, but when you develop large system only. In small system with small number of table cmr-field are very usefull...
Regards.
[ November 12, 2002: Message edited by: Volodymyr Shram ]
Ron Chan
Greenhorn

Joined: Nov 08, 2001
Posts: 11
thanx a lot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cmp EJB problem with JBoss3.x