Sorry for posting here but I don't see any Hibernate Forum
My HSQL at the moment looks like:
Code:
List matches = new ArrayList();
Criteria crt = session.createCriteria(BatchAccount.class);
String uaHQL =
"select B "+
"from BatchAccount B "+
"where " +
" B.mlaNumber in( select BA.mlaNumber " +
" from BatchAccount BA "+
" where BA.batchID = :batch_ID ) ";
matches.addAll(session.createQuery(uaHQL)
.setParameter("batch_ID", aBatchID )
.list());
for( int i=0; i<matches.size(); i++ )
{
BatchAccount batchAccount = (BatchAccount)matches.get(i);
mLog.debug( batchAccount );
batchAccount.setTransactionType( 3 );
session.save( batchAccount );
}
I'm reading back objects of Type BatchAccount.
The code works fine but I was wondered is there an easier way to modify a field/attribute in a given list of matching records without having to read back the entire object when I'm only concerned with modifying a single attribute and then persisting the object again.?>
cheers ...