View Javadoc

    1   /***
    2    * JFoxSOAF, Service-Oriented Application Framework
    3    *
    4    * Copyright (C) www.huihoo.org
    5    *
    6    * Distributable under GNU LGPL
    7    *
    8    * For more information, please visit: http://www.huihoo.org/jfox/jfoxsoaf
    9    */
    10
    11  package org.huihoo.jfox.soaf.services.persistence;
    12
    13  import net.sf.hibernate.HibernateException;
    14  import net.sf.hibernate.Session;
    15  import net.sf.hibernate.SessionFactory;
    16  import net.sf.hibernate.cfg.Configuration;
    17
    18  /***
    19   * <p>
    20   * Hibernate persistence service, Wrapper service for hibernate.
    21   * </p>
    22   *
    23   * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
    24   * @version $Revision: 1.1 $ $Date: 2004/10/19 10:34:46 $
    25   * @version Revision: 1.0
    26   */
    27
    28  public interface HibernateService {
    29
    30      /***
    31       * Create database connection and open a Session on it.
    32       *
    33       * @return a Hibernate Session object
    34       */
    35      public Session openSession() throws HibernateException;
    36
    37      /***
    38       * Return hibernate configuration.
    39       *
    40       * @return a Hibernate Configuration object
    41       */
    42      public Configuration getConfiguration() throws HibernateException;
    43
    44      /***
    45       * Create SessionFactory.
    46       *
    47       * @return a Hibernate SessionFactory object
    48       */
    49      public SessionFactory getSessionFactory() throws HibernateException;
    50
    51  }