-
1. Re: ignoring columns for update detection
sfisque Oct 17, 2008 4:54 PM (in response to sfisque)how would one go about suggesting an enhancement to Hibernate (or JPA) to include a new annotation like @NotSignificant that would allow a developer to tag an attribute, similar to @Transient, so that the attribute would be persisted and retrieved "normally" but ignored for detecting "dirtiness" of an entity when deciding if it should be persisted to the database?
== stanton -
2. Re: ignoring columns for update detection
jaikiran Oct 18, 2008 5:01 AM (in response to sfisque)There's a "updatable" attribute which you can set to false on the @Column annotation http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#Column
-
3. Re: ignoring columns for update detection
sfisque Oct 20, 2008 7:09 PM (in response to sfisque)except i want hibernate to update these columns.
the trick is to have hibernate send and receive the target columns to/from the database when doing an UPDATE, but when it is asked to merge the pojo, ignore them for deciding if the updated object is "dirty".
for the near term, i'm doing a brute force through the other attributes in a helper class "isDirty" method, but this ends up turning an O(n) test into O(2n) since hibernate is ALSO going to do this when it needs to decide if the underlying object is dirty before it commits the transaction.
the issue isnt "updatability" but "significance". in my case, the editor and updated are necessary to tag an update but are not considered "significant" with regard to object "dirtiness".
/sigh
== stanton