⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 customerdaoimpl.java

📁 一个J2EE 做的 网上图书销售管理系统
💻 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 + -