1 Reply Latest reply on Jan 16, 2009 11:06 AM by Evgeny Denisov

    How to create two entity homes of same type in one class

    Patrick Madden Newbie

      Hi, I recently cleaned up my database schema and added some foreign keys to some tables. I regenerated my entity code and also generated a CRUD application using seam gen.


      I'm running into a problem with two EntityHome classes as follows:



      @Name("userFriendHome")
      public class UserFriendHome extends EntityHome<UserFriend> 
      {
      
           @In(create = true)
           UserHome userHome;
           @In(create = true)
           UserHome userHome;
      ...
      }



      In this simple example it won't compile obviously because the two variables have the same name. However, in my case they will actually be two different users.


      Do I have to alias this somehow or do the creation myself instead of injecting them?


      Thanks in advance.


      PVM