source: ether_eccad/trunk/ECCAD_INTERFACE/WEB-INF/src/org/medias/eccad/persistance/hibernate/HibernateSGBD.java @ 68

Last change on this file since 68 was 68, checked in by cbipsl, 14 years ago

commit v1 eccad

  • Property svn:executable set to *
File size: 973 bytes
Line 
1package org.medias.eccad.persistance.hibernate;
2
3import org.hibernate.Session;
4import org.hibernate.Transaction;
5
6/**
7 * Permet l'intéraction avec un système de gestion persistante de l'information
8 * @author Jean PINAUD
9 *
10 */
11public class HibernateSGBD {
12        protected Session session;
13        protected Transaction tx;
14       
15        /**
16         * Début de la transaction
17         *
18         */
19        public void connexion() {
20//              //system.out.println("<<< Hibernate::Connexion >>>");
21                session = HibernateUtil.currentSession();
22                tx = session.beginTransaction();
23        }
24       
25        public void valider() {
26                tx.commit();
27        }
28       
29        public void annuler() {
30                tx.rollback();
31        }
32       
33        /**
34         * Fin de la transaction
35         *
36         */
37        public void deconnexion() {
38//              //system.out.println("<<< Hibernate::Deconnexion >>>");
39                HibernateUtil.closeSession();
40                tx = null;
41                session = null;
42        }
43       
44        /**
45         * Constructeur par défaut
46         *
47         */
48        public HibernateSGBD() {
49                tx = null;
50                session = null;
51        }
52       
53}
Note: See TracBrowser for help on using the repository browser.