1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| @Override
public List getAllDelai() {
Session session=HibernateUtil.getSessionFactory().getCurrentSession();
try{
session.getTransaction().begin();
Query req=session.createSQLQuery("select IMMAT,ID_FOURNISSEUR,DATE_DEBUT,DATEDIFF ( dd ,DATE_FIN,GetDate() ) as DELAI where DATEDIFF ( dd ,DATE_FIN,GetDate() )>-30 ");
//Query req=session.createQuery("select ass from Assurance ass");
return (req.list());
}
catch (RuntimeException e) {
session.getTransaction().rollback();
throw e;
}finally{
session.getTransaction().commit();
}
}
} |
Partager