[jboss-user] [EJB 3.0] - Association Class mapping with composite primary key

celsogbj do-not-reply at jboss.com
Thu Aug 10 19:34:57 EDT 2006


Hi,

I am having a problem trying to mapping an association class with EJB 3 on JBoss. 
I have a class A with a many-to-many mapping with B and an association class C which has an attribute. I implemented using an one-to-many mapping with A and C and another one bettwen C and B. So far so good.

My problem is that table C has a composite primary key made of a_id and b_id. So, when I implemented C I had to mark the relationships (C with A, C with B) as the primary key (with a primary key class) which resulted on a ?C_PK has no persistent id property? when deployed in JBoss.

Is there any way to mapping this association class with the primary key being composed by the relationship? Is there any workaround (without using surrogated keys)? Does anybody has any code as example to post? I?ve already searched the achieves and haven?t found anything really helpful.

Thanks in advance,
Celso

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

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



More information about the jboss-user mailing list