Re: [appfuse-user] Basic One-To-Many

2007-05-23 Thread Luke McLean
Here is a real example taken from code that is working: I have a User class that has a one to many association with a Profile(address+email). In the User class I have the following code: @OneToMany (mappedBy="user") public Set getProfiles(){ return profiles;

Re: [appfuse-user] Basic One-To-Many

2007-05-23 Thread Luke McLean
Hi Paulie, The example you posted is quite jumbled, you have some annotations and also some xdoclet tags in the same example. The first thing that you need to do it decide which you are going to use (I would suggest the annotations and remove the xdoclet tags). Hibernate can be quite confusing

Re: [appfuse-user] Basic One-To -Many

2007-05-21 Thread Rick Guo
16 21:36:49 收件人:users@appfuse.dev.java.net 抄送:(无) 主题:[appfuse-user] Basic One-To-Many I have been looking through the forum and user guides trying to piece together the code for putting together a one-to-many relationship. In my code, a Person can have many Addresses. The error I am getting is M

Re: [appfuse-user] Basic One-To-Many

2007-05-16 Thread Thomas Ramapuram
You should remove the old hibernate xdoclet tags and use the new JPA annotations. The Person Class and the Address Class should be marked as @Entity. paulie wrote: I have been looking through the forum and user guides trying to piece together the code for putting together a one-to-many relat

Re: [appfuse-user] Basic One-To-Many

2007-05-16 Thread Philip Barlow
Try: private Set addresses = new HashSet(); HashSets cannot contain duplicates and are generally a better fit. One thing to note when using HashSets, always implement hashCode in objects that may end up inside a hashSet, this is how they are checked for uniqueness. I learned this the hard way

Re: [appfuse-user] Basic One-To-Many

2007-05-16 Thread Philip Barlow
I see you have used commonclipse to generate the hashcode, great plugin, apologies for not reading all of your post :) paulie wrote: I have been looking through the forum and user guides trying to piece together the code for putting together a one-to-many relationship. In my code, a Person can

[appfuse-user] Basic One-To-Many

2007-05-16 Thread paulie
I have been looking through the forum and user guides trying to piece together the code for putting together a one-to-many relationship. In my code, a Person can have many Addresses. The error I am getting is MappingException: Could not determine type for: java.util.List, for columns: [org.hiber