hibernate 3.5.3
Code:
@Entity("tablename")
@SQLUpdate(sql="UPDATE tablename SET VERSION=?, param1=?, param2=? WHERE ID=? and (param3 is null)")
public class TablName{
@Id
@Column(name = "ID", scale = 0, precision = 10)
private Long id;
@Version
@Column(name = "VERSION", scale = 0, precision = 10)
private Long version;
....
Look AbstractEntityPersister, method update
Code:
int index = 1; // starting index
after "dehydrate": index = 5
Code:
index = dehydrate( id, fields, rowId, includeProperty, propertyColumnUpdateable, j, update, session, index );
then
Code:
if ( useVersion && Versioning.OPTIMISTIC_LOCK_VERSION == entityMetamodel.getOptimisticLockMode() ) {
getVersionType().nullSafeSet( update, oldVersion, index, session );
we have 5 params(0-4), but nullSafeSet receive index = 5 and throws SQLexception
where is my mistake?