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

📄 bookdaoimpl.java

📁 一个J2EE 做的 网上图书销售管理系统
💻 JAVA
字号:
package com.briup.dao.imp;

import org.hibernate.Query;
import org.hibernate.Session;

import com.briup.bean.BookForm;
import com.briup.bean.RegisterForm;
import com.briup.common.HibernateSessionFactory;
import com.briup.dao.IBookDao;
import com.briup.dao.ICustomerDao;

public class BookDaoImpl implements IBookDao {
	public BookForm findCustomerByName(String name) throws Exception {
		Session session = HibernateSessionFactory.getSession();
		Query query = session.createQuery("from book where name = ?");
		query.setString(0, name);
		System.out.println("22");
		return (BookForm) query.uniqueResult();
	}

	public void saveOrupdateBook(BookForm book) throws Exception {
		Session session = HibernateSessionFactory.getSession();
		session.saveOrUpdate(book);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -