File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes how to assign compsite keys manually Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "how to assign compsite keys manually" Watch "how to assign compsite keys manually" New topic

how to assign compsite keys manually

vamshidhar nimbagiri
Ranch Hand

Joined: Oct 04, 2004
Posts: 61
i am using hiberate method and passing my mapping class object which contains the composite key.; but its trhowing an exception saying ids for this class must be manually assigned before calling save(): com.wpsmedicare.corporate.entity.medicare.MedicareProvider
at java.lang.Throwable.<init>(
at java.lang.Throwable.<init>(
at org.hibernate.exception.NestableRuntimeException.<init>(
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(

I have two classes one my mapping class and compositekey class which contains the composite fields info. plz tell me how to set this composite keys before inserting or calling save() method.

Thanks in Advance,

Vamshidhar Nimbagiri
SCJP 5.0
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: how to assign compsite keys manually
jQuery in Action, 3rd edition