Using Enum in Hibernate causes select followed by an update statement

Posted by Leonardo on Stack Overflow See other posts from Stack Overflow or by Leonardo
Published on 2011-01-07T14:42:36Z Indexed on 2011/01/07 16:54 UTC
Read the original article Hit count: 169

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about enums