[hibernate-dev] Fwd: Hibernate field with custom type changes, but object not marked as 'dirty' for update
Adnan Raza
adnanfaizan at gmail.com
Wed May 1 07:47:13 EDT 2013
Hello,
Currently I am facing issue with hibernate. I have a Entity class as given
below.
@Entity
@Table(name = TABLE_NAME)
@Access(AccessType.FIELD)
public class EntityClass {
//some fields
//*@Access(AccessType.PROPERTY)*
*@Column(name = "WA_DEFINED_TAB_INDEXES")*
* @Type(type = SetToArrayUserType.CLASS_NAME)*
private Set<Integer> oracleArray = new HashSet<>(10);
@Version
@Column(name = "versionCol" , nullable = false)
private Integer rhpVersion = 0;
//some getters/setters
}
In case of AccessType.FIELD mapping, Hibernate doesn't mark object as dirty
and doesn't update row when we only have changes in the fields that is
mapped for custom type. If we have AccessType.PROPERTY mapping, Hibernate
do mark object dirty and make update into database.
is it bug in hibernate?
I there is an open question also
http://stackoverflow.com/questions/1268997/hibernate-field-with-custom-type-changes-but-object-not-marked-as-dirty-for-u
For the solution, either I will be forced use AccessType.PROPERTY or I have
to mix FIELD and PROPERTY approach.
Please let me know your thoughts about this.
--
*With Best Regards,*
*
** Mohd Adnan*
* Software Developer*
*Mobile +91-7498194516 *
--
*With Best Regards,*
*
** Mohd Adnan*
* Software Developer*
*Mobile +91-7498194516 *
* Office id **adnan at synygy.com*
More information about the hibernate-dev
mailing list