-->
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: Unidirectional mapping with object containing composite keys
PostPosted: Wed Mar 11, 2009 10:43 am 
Newbie

Joined: Thu Apr 20, 2006 5:31 am
Posts: 3
I have a BundleVO class which needs one-to-Many unidirectional association with ServiceDetailsVO class. ServiceDetailsVO contains composite primary key, one of the key being supplied from other model object

When i give the below association in BundleVO

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name="Bundle_Id", nullable = false)
public Set<ServiceDetailsVO> getServiceDetails() {
return this.serviceDetails;
}


It throws me the exception
Caused by: org.hibernate.MappingException: Unable to find column with logical name: Bundle_Id in service_details


ServiceDetailsVO

Entity
@Table(name = "service_details")
public class ServiceDetailsVO implements java.io.Serializable {

private ServiceDetailsId id;

//Other fields


}

@Embeddable
public class ServiceDetailsId implements java.io.Serializable {

//Other model object giving one of the composite id
private ServiceModelVO serviceModel;

// No reference to BundleVO - i dont want to retain this bi-directional relationship with bundle
//private BundleVO bundle;
}

Please let me know how to provide the mappings in such a way that unidirectional for object with composite key is achieved

_________________
VINOD JAYENDRA


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.