Using Enum in Hibernate causes select followed by an update statement
- by Leonardo
Hi all,
I have a mapped entity wich has an enum property.
By loking at log file, whenever I run a select statement on such entity, the result is an immediately following update.
For example if my result set contains 100 records, then I have:
[INFO org... select...]
[INFO org... update... where id=?]
[INFO org... update... where id=?]
.... repeated 100 times
If I mark the property as update=false the problem disappear.
The enum is assigned trough an enum converter class, which I copied from a well known book.
So I don't know if I just copy and paste the code. Here it is how is declared on hbm file.
<typedef class="mypackage.HbnEnumConverter" name="the_type">
<param name="enumClassname">mypackage.TheType</param>
</typedef>
Can you point out a direction to investigate this ? Beside, what are the consequences of having update=false on hibernate field ?
thanks