0 Replies Latest reply on Sep 16, 2005 2:02 AM by infodavid

    Remote interface and associations

    infodavid

      I want to use this interface named 'ICity' :

      @Remote
      public interface ICity extends Serializable {
       public String getName() throws RemoteException;
      
       public void setName(String s) throws RemoteException;
      
       public String getCode() throws RemoteException;
      
       public void setCode(String s) throws RemoteException;
      
       public String getCountry() throws RemoteException;
      
       public void setCountry(String o) throws RemoteException;
      }


      for association in :

      @javax.persistence.Entity(access = AccessType.PROPERTY)
      @Table(name = "ENTITIES")
      @Inheritance(strategy = InheritanceType.JOINED)
      public class Entity extends AbstractSimpleEntity implements IEntity {
       private ICity city = null;
      ...
      
       public Entity() { }
      
       public Entity(Entity o) { super(o); }
      
       @Id(generate = GeneratorType.TABLE)
       @Column(name = "entity_id", nullable = false, unique = true)
       public long getPrimaryKey() { return id; }
      
      ...
      
       @ManyToOne(fetch = FetchType.LAZY)
       @JoinColumn(name = "city_id")
       public ICity getCity() throws RemoteException { return city; }
      
       public void setCity(ICity o) throws RemoteException { city = (City)o; }
      ...
      }


      but the entity manager can't find the associated and concrete city object (implemented in class 'City').

      How can I do with this, which object do I used in the methods of 'Entity' ?