-
1. Re: multiple foreign key references to same table
degzhaus Feb 12, 2008 10:52 PM (in response to degzhaus)I know this is a mundane question...and maybe the answer is to just work around this problem by modifying both the FriendsEdit.xhtml view and the UsersList.xhtml view to interact on a more granular level. I'm a bit at a loss figuring out what exactly to research. Is it as simple as knowing more about the custom jsf tags?
-
2. Re: multiple foreign key references to same table
degzhaus Feb 13, 2008 5:10 PM (in response to degzhaus)Problem solved. My issue was caused by trying to reference the UserHome object twice in the FriendsHome object. The Seam Documentation explains how to configure this two ways. These home objects must be singletons of some sort, so all I had to do was create a OwnersHome object as well as a FriendsHome object modeled after the generated UsersHome object. Everything is functioning per design now, with both foreign keys.
Beautiful work Seam team!
-
3. Re: multiple foreign key references to same table
phoneixace Sep 23, 2008 11:06 PM (in response to degzhaus)Hi John,
I am new to seam.
You are the only one here. I have the same problem with u.
I would like to ask how did u solve the problem. I downloaded the latest seam version.
jboss-seam-2.1.0.BETA1( 23/09/2008)
I have a tables which has 2,3 foreign keys to other same table. In terms of your db,
The friends table looks like (simplified): id, ownerid (foreign key to users(id)), friendid (foreign key to users(id))
Friends : id
ownerid
friendid generates a java class , with seam generate-entities
public class FriendsHome extends EntityHome<Friends> {
@In(create = true)
UserHome userHome;
@In(create = true)
UserHome userHome;
.......................
As I wrote it generates 2fields with same name.So duplicate field. I did correction by hand.But I do not know the rigth strategy. You said everything is fine.Did you generate files correctly. How do u handled this case in Home object.
Could u tell me how u handled this case,How does your home object look like,how u have generated it.
Thanks for help..