[JBoss-user] [EJB 3.0] - Re: Composite pk/fk

2006-02-09 Thread epbernard
show a code snipset View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3922735#3922735 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3922735 --- This SF.net email is

[JBoss-user] [EJB 3.0] - Re: composite PK/FK

2006-01-26 Thread DWebster
So, for further enlightenment could you provide a code snippet of a stateless session bean that contains a method for returning a list of regions from a specific country code? A partial compound key lookup. I have never gotten one of those to work. Thanks View the original post :

[JBoss-user] [EJB 3.0] - Re: composite PK/FK

2006-01-02 Thread danjourno
i forgot to add referencedColumName to the JoinColumn Annotation when defining the foreign composite key relationship. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3915149#3915149 Reply to the post :

[JBoss-user] [EJB 3.0] - Re: composite PK/FK

2006-01-01 Thread danjourno
yep.. I finally sorted this one out. I'll post the code for my files for a reference as this is a slightly different example to the one in the wiki. I've included the location class which shows how the composite foreign key is referenced. @Entity | @Table(name=country) | public class

[JBoss-user] [EJB 3.0] - Re: composite PK/FK

2005-12-30 Thread epbernard
did you remove this one @OneToMany(fetch=FetchType.LAZY,mappedBy=country) | public java.util.ListCountryRegion getCountryRegion() { | return countryRegion; | } View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3915034#3915034 Reply to the

[JBoss-user] [EJB 3.0] - Re: composite PK/FK

2005-12-29 Thread [EMAIL PROTECTED]
only Basic, Column, Lob, Temporal, and Enumerated can be used to map a @Embedded class. Thus, you can't use Country as a primary key. That's one problem I see. Another is that the @OneToMany on Country to CountryRegion is not bidirectional, so the mappedby would not work. You'd have to do:

[JBoss-user] [EJB 3.0] - Re: composite PK/FK

2005-12-29 Thread danjourno
Thanks Bill, I'll give that a go an let you know of the results. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3914854#3914854 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3914854

[JBoss-user] [EJB 3.0] - Re: composite PK/FK

2005-12-29 Thread danjourno
I've just set things up the way you have suggested. My PK class now has a String value referring to the country_code_1 rather than the actual country object. @Embeddable | public class CountryRegionPK implements java.io.Serializable{ | ... | |public String getCountryCode1()