These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: @JoinColumns
PostPosted: Tue Nov 22, 2011 5:00 pm 
Newbie

Joined: Tue Nov 22, 2011 4:29 pm
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.