[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-1126) Generate-entities creates a class with the error

Dan Allen (JIRA) jira-events at lists.jboss.org
Sun Sep 30 01:16:41 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBSEAM-1126?page=comments#action_12379459 ] 
            
Dan Allen commented on JBSEAM-1126:
-----------------------------------

Here is an explanation for why the seam-gen created project cannot handle this scenario.

Assume that you are defining a relationship between two entities instances of the same entity. Consider the simple case of associating friends, so we will call the entity Person. We will then give them a type of friendship.

Friend
  Person getPerson()
  Person getPersonFriend()
  String getTypeOfFriend() // best friend, acquaintance, coworker

FriendHome
  @In(create=true)
  personHome
  @In(create=true)
  personHome // oops, this is were we have an error an need to nuke

The application is going to give you can input box for the type of friend. Then you have to go select a person and a personFriend association. However, there is only one PersonList page that will pass the id as personId when a person is selected. The *.page.xml file is going to look for personId and assign it to the home reference personHome. This is where you get the second home reference, because you also need to do the same selection process for the person friend, only there is no personFriendHome.

To handle this scenario, you are going to have to hack in your own logic, or the seam-gen app is going to have to get smarter. The way I see it, let's fix the compilation error until we have a more intelligent solution.

> Generate-entities creates a class with the error
> ------------------------------------------------
>
>                 Key: JBSEAM-1126
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1126
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: EJB3
>    Affects Versions: 1.2.1.GA, 1.2.0.GA
>            Reporter: Alex Narinsky
>            Priority: Minor
>         Attachments: JBSEAM-1126-v1.txt, JBSEAM-1126-v1.txt
>
>
> I am using generate-entities.  Prior to version 1.2 this worked fine.  Starting from version 1.2 one generated class contains the error - double definition of one "In" element.
> Please, see the text below 
> @Name("moviesHome")
> public class MoviesHome extends EntityHome<Movies> {
> 	@In(create = true)
> 	ContactsHome contactsHome;
> 	@In(create = true)
> 	ProjectsHome projectsHome;
> 	@In(create = true)
> 	ContactsHome contactsHome;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list