KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > javabb > transaction > Transaction


1 package org.javabb.transaction;
2
3 import java.util.List JavaDoc;
4
5 import org.apache.commons.logging.Log;
6 import org.apache.commons.logging.LogFactory;
7 import org.javabb.dao.hibernate.HibernateDAO;
8
9 /*
10  * Copyright 2004 JavaFree.org
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */

24
25 /**
26  * $Id: Transaction.java,v 1.7.10.3 2006/08/01 22:30:36 daltoncamargo Exp $
27  * @author Dalton Camargo - <a HREF="mailto:dalton@javabb.org">dalton@javabb.org </a> <br>
28  * @author Ronald Tetsuo Miura
29  */

30 public class Transaction {
31     protected final Log log = LogFactory.getLog(getClass());
32     
33     private HibernateDAO genericDAO;
34     public void setGenericDAO(HibernateDAO genericDAO) {
35         this.genericDAO = genericDAO;
36     }
37     
38     public void add(Object JavaDoc instance) throws Exception JavaDoc {
39         genericDAO.add(instance);
40     }
41
42     public List JavaDoc loadAll(Object JavaDoc instance) throws Exception JavaDoc {
43         return genericDAO.loadAll(instance);
44     }
45
46     public Object JavaDoc load(Object JavaDoc instance, Long JavaDoc id) throws Exception JavaDoc {
47         return genericDAO.load(instance, id);
48     }
49
50     public void delete(Object JavaDoc instance) throws Exception JavaDoc {
51         genericDAO.delete(instance);
52     }
53     
54 }
55
Popular Tags