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
|