📄 agile.java
字号:
/*
* Created on 2004-10-12 TODO To change the template for this generated file go to Window - Preferences - Java - Code
* Style - Code Templates
*/
package com.hongsoft.agile;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import com.hongsoft.agile.hibernate.HibernateBase;
import com.hongsoft.agile.hpdl.HpdlFacade;
/**
* 接口部分都抛出AgileException TODO To change the template for this generated type comment go to Window - Preferences - Java -
* Code Style - Code Templates
*/
public class Agile {
public static AgileConnection connectToServer() throws HibernateException, AgileException {
Session session = HibernateBase.getSession();
// 读取流程定义
HpdlFacade.getProcessesObject(session);
// 建立连接
return new AgileConnection(session, session.beginTransaction());
}
public static void disConnectServer(AgileConnection connection, boolean toCommit) throws HibernateException {
if (toCommit)
connection.getTransaction().commit();
else
connection.getTransaction().rollback();
HibernateBase.closeSession();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -