1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| public static List<Document> getDocuments(String chemin){
Session session = null;
List<Document> lst = new ArrayList<Document>();
try {
session = HibernateUtil.currentSession();
lst = (List<Document>) session.createQuery("from Document where chemin=:path").setParameter("path", chemin).list();
for(Document docu : lst){
System.out.println("Le nom de document recuperee du Mysql est:::::"+docu.getNom());
}
HibernateUtil.closeSession();
} catch (Exception e) {
e.printStackTrace();
System.out.println("HibernateException -- HibernateDB::getDocuments: "+e);
}
return lst ;
} |
Partager