Monday, January 16, 2006

Hibernate error: identifier of an instance of ... was altered

My error:
identifier of an instance of hibernate.databaseTables.TariffTypeValue was altered from 7 to 0
After some search, the error must be due to the code:
Integer id = (Integer) session.save(TariffType);
TariffType.settarifftypeid(id);
And what was the problem, simple, in the TariffTypeValue class which is my persistence class,
I had the following code to set the ID:
tarifftypeid = tarifftypeid;
Change this to
this.tarifftypeid = tarifftypeid;
and the error 'll be solved.
This was a very easy and stupid error but the error message made it confusing.

1 comment:

Anonymous said...

oh.. thank u man ... helped me on this problem which i spent a whole morning ...