Bonjour,
j utilise une metohe static dans un pojo pour récupérer une instance de ce dernier:
Code:
public class Tab1Bean implements Serializable {
//....
public static Tab1Bean getTab1Bean(String id){
Tab1Bean result=null;
Session session = HibernateUtil.currentSession();
result =(Tab1Bean ) session.load(Tab1Bean.class, id);
HibernateUtil.closeSession();
return result;
}
}
je voudrais appeler cette methode par tout dans l appli.
comment configurer hibernate3, pour que :
-si objet n'est pas modifier, alors récupérer l'instance sans interroger la base
-si objet est modifie, alors récupérer l'instance de la base.
merci
Hibernate version:3