-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: [chargement] class
PostPosted: Tue Jan 03, 2006 4:40 pm 
Newbie

Joined: Tue Dec 13, 2005 1:11 pm
Posts: 6
Location: casaBlanca
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.