It's not a secret anymore!
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
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
I agree. Here's the link:
subject: how to assign compsite keys manually
It's not a secret anymore!