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

Guido Simone (JIRA) jira-events at lists.jboss.org
Mon Aug 18 10:40:58 EDT 2008


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


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