Joined: Wed Feb 15, 2006 7:51 pm Posts: 9 Location: Sydney, Australia
|
I've got an entity mapped that's using the table-per-class-hierarchy design. As a result, there's a discriminator column called 'itemtype'. This is all working fine and Hibernate correctly instantiates the appropriate subclass. However, my code needs to be able to directly acess that itemtype property as in: myItem.getItemType(). To do that, I mapped a property separate from the discriminator which doesn't update or insert:
<property name="itemType" column="itemtype" not-null="true" update="false" insert="false" />
Unfortunately, this value doesn't seem to be set by Hibernate until after the object is first saved to the db. But my code needs to be able to get the value at any time (whether or not it has been saved). Is there any way to obtain the value before Hibernate has saved the object?
|
|