📄 factory.java
字号:
package com.autumn.pojo.oper;
import org.hibernate.Session;
import org.hibernate.cfg.Configuration;
public class Factory {
private static Session session = null ;
public static BookOper getBookOperInstance()
{
return new BookOper() ;
}
public static BorrowedOper getBorrowedOperInstance()
{
return new BorrowedOper() ;
}
public static ManagerOper getManagerOperIntance()
{
return new ManagerOper() ;
}
public static ReaderOper getReaderOperIntance()
{
return new ReaderOper() ;
}
public static HistoryOper getHistoryOperInstance()
{
return new HistoryOper() ;
}
public static Session getSession()
{
if(session==null||!session.isOpen()){
session=new Configuration().configure().buildSessionFactory().openSession();
}
return session ;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -