Here is my code in dao layer..can anyone please help me to delete multiple records from database in the table mapped to SabbModelPrd using the condition equal to ("clientid", strClientId) which is not the primary key . Thanks in advance...
public boolean deleteAllServices(String strClientId){
boolean flag = false;
try {
Session session = sessionFactory.getCurrentSession();
SabbModelPrd sabbModelPrd = (SabbModelPrd) session.get(SabbModelPrd.class, strClientId);
if (!StringUtils.isEmpty(sabbModelPrd)) {
session.delete(sabbModelPrd);
flag = true;
}
} catch (Exception e) {
}
return flag;
}
here its checking strClientId with the primary key product_id