📄 adapterdao.java
字号:
package appjxc.dao;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import appjxc.model.*;
import java.util.List;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
import javax.swing.JOptionPane;
import appjxc.view.JF_view_error;
public class AdapterDao {
private Resource resource = null;
private XmlBeanFactory factory = null;
private static DaoSupport dao = null;
public AdapterDao(){
// getdao();
}
public boolean getdao(){
try{
this.resource = new ClassPathResource("appcontext.xml");
System.out.println("resourc = " + resource);
this.factory = new XmlBeanFactory(resource);
System.out.println("factory = " + factory);
this.dao = (DaoSupport) factory.getBean("DAOProxy");
System.out.println("dao = " + dao);
//JOptionPane.showMessageDialog(null,"初始化数据成功!!!","系统提示",JOptionPane.INFORMATION_MESSAGE);
return true;
}catch(Exception e){
e.printStackTrace();
System.out.println("Erro; = " + e.getMessage());
JF_view_error error = new JF_view_error(e.getMessage());
error.setTitle("初始化数据连接失败,错误信息如下:");
return false;
//JOptionPane.showMessageDialog(null,"初始化数据失败,错误信息如下:\n" + e.getMessage(),"系统提示",JOptionPane.INFORMATION_MESSAGE);
}
}
public static boolean insertmedicine(obj_medicine medicine){
return dao.InsertMedicine(medicine);
}
public static boolean insertclient(Obj_client objclient){
return dao.InsertClient(objclient);
}
public static boolean insertmedicine(Obj_gys objgys){
return dao.InsertMedicine(objgys);
}
public static boolean InsertSellMain(Obj_SellMain obj){
return dao.InsertSellMain(obj);
}
public static boolean InsertSellDetaile(Obj_SellDetaile obj){
return dao.InsertSellDetaile(obj);
}
public static boolean InsertBuyMain(Obj_BuyMain obj){
return dao.InsertBuyMain(obj);
}
public static boolean InsertBuyDetaile(Obj_BuyDetaile obj){
return dao.InsertBuyDetaile(obj);
}
public static boolean InsertStock(Obj_Stock obj){
return dao.InsertStock(obj);
}
public static boolean InsertObj_SellDetaileTh(Obj_SellDetaileTh obj){
return dao.InsertObj_SellDetaileTh(obj);
}
public static boolean InsertObj_UserName(Obj_UserName obj){
return dao.InsertObj_UserName(obj);
}
public static List QueryObject(String str){
return dao.QueryObject(str);
}
public static void DeleteUser(Obj_UserName user){
dao.DeleteUser(user);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -