⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 daofactory.java

📁 网上拍卖系统
💻 JAVA
字号:
package auction.dao;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;/** * Defines all DAOs and the concrete factories to get the conrecte DAOs. * <p> * To get a concrete DAOFactory, call <tt>instance()</tt> with one of the * classes that extend this factory. * <p> * Implementation: If you write a new DAO, this class has to know about it. * If you add a new persistence mechanism, add an additional concrete factory * for it as a constant, like <tt>HIBERNATE</tt>. * * @author Christian Bauer */public abstract class DAOFactory {    private static Log log = LogFactory.getLog(DAOFactory.class);    /**     * Creates a standalone DAOFactory that returns unmanaged DAO     * beans for use in any environment Hibernate has been configured     * for. Uses HibernateUtil/SessionFactory and Hibernate context     * propagation (CurrentSessionContext), thread-bound or transaction-bound,     * and transaction scoped.     */    public static final Class HIBERNATE = auction.dao.hibernate.HibernateDAOFactory.class;    /**     * Factory method for instantiation of concrete factories.     */    public static DAOFactory instance(Class factory) {        try {            log.debug("Creating concrete DAO factory: " + factory);            return (DAOFactory)factory.newInstance();        } catch (Exception ex) {            throw new RuntimeException("Couldn't create DAOFactory: " + factory);        }    }    // Add your DAO interfaces here    public abstract ItemDAO getItemDAO();    public abstract CategoryDAO getCategoryDAO();    public abstract CommentDAO getCommentDAO();    public abstract UserDAO getUserDAO();    public abstract CategorizedItemDAO getCategorizedItemDAO();    public abstract BillingDetailsDAO getBillingDetailsDAO();    public abstract ShipmentDAO getShipmentDAO();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -