session = sessionFactory.openSession();
Criteria criteria = session.createCriteria(BOCustomField.class);
criteria.add(Restrictions.ilike("customFieldModule", "tasks"));
criteria.add(Restrictions.ilike("customFieldName", "Module"));
BOCustomField.CustomTaskModule = (BOCustomField) criteria.list().get(0);
} catch (Exception a_th) {
throw new RuntimeException(a_th);
} finally {
close(sessionFactory, session);
}