Currently I m using the traditional method of updating my tables. I m iterating over my list and updating it individually.
here is my code
Iterator iterator = cabRequests.iterator(); CabRequestDTO cabRequest = null; int requestId = 0; try { while( iterator.hasNext() ) { cabRequest = ( CabRequestDTO ) iterator.next(); Query query = getSession().createQuery( PersistenceConstants.SQL_UPDATE_TABLE_CHANGE_STATUS ); query.setInteger( PersistenceConstants.FIELD_REQUEST_ID, cabRequest.getRequestId().intValue()); query.setEntity( PersistenceConstants.FIELD_DESCRIPTION, cabRequest.getCabRequestStatus() ); query.executeUpdate(); } }
Is there any other optimized way of doing it using hibernate bulk update method. I m searching over the net but could not find the code.
Regards
|