customerdaoimpl.java
来自「一个J2EE 做的 网上图书销售管理系统」· Java 代码 · 共 30 行
JAVA
30 行
package com.briup.dao.imp;
import org.hibernate.Query;
import org.hibernate.Session;
import com.briup.bean.RegisterForm;
import com.briup.common.HibernateSessionFactory;
import com.briup.dao.ICustomerDao;
public class CustomerDaoImpl implements ICustomerDao {
public RegisterForm findCustomerByName(String name) throws Exception {
// TODO Auto-generated method stub
Session session = HibernateSessionFactory.getSession();
Query query = session.createQuery("from RegisterForm where name = ?");
query.setString(0, name);
System.out.println("11");
return (RegisterForm)query.uniqueResult();
}
public void saveOrupdateCustomer(RegisterForm customer) throws Exception {
// TODO Auto-generated method stub
Session session = HibernateSessionFactory.getSession();
//System.out.println("22"+customer.getPassword());
session.saveOrUpdate(customer);
//System.out.println("22");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?