📄 bookdaoimpl.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 + -