Hi
I'm trying to use findDirty function of Interceptor interface to exclude some properties names from update query(i don't want them to be updated when function saveOrUpdate was called on entity). In order to accomplish that i'm returning from findDirty function array of indeces of all properties but this particular property name :
Code:
public int[] findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) {
int [] ret_val=new int[propertyNames.length-1];
int j=0;
for (int i = 0; i < propertyNames.length; ++i) {
if(!propertyNames[i].equalsIgnoreCase("image")){
ret_val[j]=i;
++j;
}
}
return ret_val;
}
The problem is that image column is still updated...
What am i doing wrong? Do i use findDirty method correctly?
Thanks