Following are my entities @Entity @Table(name = "BASE_RESOURCE") @Inheritance(strategy = InheritanceType.JOINED) public class BaseResource implements Serializable {
@Entity @Table(name = "PRODUCT_RESOURCE") public class ProductResource extends BaseResource implements Serializable {
@Entity @Table(name = "ORDER_ADOPTION") public class OrderAdoption implements Serializable {
@ManyToOne(fetch=FetchType.LAZY,targetEntity=ProductResource.class) @JoinColumns({ @JoinColumn(name="RESOURCE_KEY", referencedColumnName="RESOURCE_KEY"), @JoinColumn(name="ROLE_ID",referencedColumnName="ROLE_ID"), @JoinColumn(name="PUBLISHED_FLAG", referencedColumnName="PUBLISHED_FLAG") }) private ProductResource productResource; }
All these three join columns are existing in BaseResource and not there in the ProductResource.
When trying to fetch the ProductResource in adoption its always trying to find those columns in the product table, its not searching in BaseResource table.
Can any one has a solution to that?
Or i am doing something wrong?
|