[seam-issues] [JBoss JIRA] Closed: (JBSEAM-3278) seam-gen generate-ui problem - entity in a different package

Pete Muir (JIRA) jira-events at lists.jboss.org
Fri Jan 22 09:21:30 EST 2010


     [ https://jira.jboss.org/jira/browse/JBSEAM-3278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pete Muir closed JBSEAM-3278.
-----------------------------



> seam-gen generate-ui problem - entity in a different package 
> -------------------------------------------------------------
>
>                 Key: JBSEAM-3278
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3278
>             Project: Seam
>          Issue Type: Bug
>          Components: Tools
>            Reporter: Guido Simone
>            Assignee: Dan Allen
>             Fix For: 2.0.3.CR2, 2.1.2.CR1
>
>
> Here is an example:
> The entity class PersonAddress has a ManyToOne relationship with Address which happens to be in a different package.  The seam generate-ui command will generate (among other things) an EntityHome class named PersonAddressHome.
> //==================================
> // PersonAddress
> package com.domain.model.person;
> import com.domain.model.location.Address;
> @Entity
> public class PersonAddress
> {
>    private Address address;
>    private PersonAddressTypeLookup addressTypeLookup;
>    private Person person;
>    @ManyToOne @NotNull
>    public Address getAddress() {return address;}
>    @ManyToOne @NotNull
>    public PersonAddressTypeLookup getAddressTypeLookup()   
>    { return addressTypeLookup; }
>    @ManyToOne @NotNull
>    public Person getPerson() {return person;}
>    // setters omitted
> }
> which generates: 
> //==================================
> // PersonAddressHome
> package com.domain.action;
> import com.domain.model.person.*;
> import org.jboss.seam.annotations.In;
> import org.jboss.seam.annotations.Name;
> import org.jboss.seam.framework.EntityHome;
> @Name("personAddressHome")
> public class PersonAddressHome extends EntityHome<PersonAddress>
> {
>    // code omitted...
>    public void wire()
>    {
>       getInstance();
>       Address address = addressHome.getDefinedInstance();
>       if (address != null)
>       {
>          getInstance().setAddress(address);
>       }
>       PersonAddressTypeLookup addressTypeLookup = addressTypeLookupHome
>             .getDefinedInstance();
>       if (addressTypeLookup != null)
>       {
>          getInstance().setAddressTypeLookup(addressTypeLookup);
>       }
>       Person person = personHome.getDefinedInstance();
>       if (person != null)
>       {
>          getInstance().setPerson(person);
>       }
>    }
> The generated code imports all entities in com.domain.model.person, but does not import anything from com.domain.model.location so the compilation fails in the second line of the wire() method (Address cannot be resolved to a type). 

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

        


More information about the seam-issues mailing list