📄 drivermanager.java
字号:
package com.gzrealmap.oa.car.business;
/**
* <p>Title: RealOA</p>
* <p>Description: RealOA</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: gzrealmap.com</p>
* @author not attributable
* @version 1.0
*/
import com.gzrealmap.oa.car.*;
import com.gzrealmap.lib.hibernate.HibernateUtil;
import java.io.*;
public class DriverManager {
public DriverManager() {
}
public static void addDriver(DriverBean newDriver) throws Exception {
HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
try {
//theHibernateUtil.connect();
theHibernateUtil.create2Db(newDriver);
}
catch (Exception ex) {
}
}
public static DriverBean findDriver(Integer obj) throws Exception {
HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
return (DriverBean) theHibernateUtil.findByPrimaryKey(DriverBean.class,
obj);
}
public static void updateDriver(DriverBean theUpdateDriver) throws
Exception {
HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
theHibernateUtil.update2Db(theUpdateDriver);
}
public static void removeDriver(DriverBean theRemoveDriver) throws
Exception {
HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
theHibernateUtil.remove4Db(theRemoveDriver);
}
/*public static void main(String[] args) throws Exception{
new DriverManager();
DriverBean driver = new DriverBean();
driver.setUserID(111);
driver.setCarNo("999");
driver.setDriverNo("123");
driver.setPeccancyCount(111);
addDriver(driver);
}
/* public static void main(String[] args) throws Exception{
new DriverManager();
DriverBean driver1= new DriverBean();
driver1.setCarNo("999");
driver1.setDriverNo("123");
driver1.setPeccancyCount(111);
addDriver(driver1);
DriverBean driver2= new DriverBean();
driver2.setCarNo("999");
driver2.setDriverNo("123");
driver2.setPeccancyCount(111);
addDriver(driver2);
DriverBean driver = new DriverBean();
driver= findDriver(new Integer(1));
removeDriver(driver);
}
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -