📄 customerdaoimpl.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -