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; }
@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; } ... }