customerdaoimpl.java
来自「该程序能够准确的记录互联网用户上网所用的流量」· Java 代码 · 共 38 行
JAVA
38 行
package com.briup.customer.dao.impl;import org.apache.commons.lang.StringUtils;import org.hibernate.Query;import org.hibernate.Session;import org.springframework.orm.hibernate3.HibernateTemplate;import com.briup.common.dao.pojo.Product;import com.briup.common.dao.pojo.User;import com.briup.customer.dao.ICustomerDao;public class CustomerDaoImpl extends HibernateTemplate implements ICustomerDao { // 修改用户信息 public void updateCustomerInfo(User user) throws Exception { // TODO Auto-generated method stub super.saveOrUpdate(user); } // 通过品牌名称查询品牌信息 public Product getProductInfo(String name) throws Exception { // TODO Auto-generated method stub Query query = null; if(StringUtils.isNotEmpty(name)){ Session session = this.getSession(); query = session.createQuery("from Product where name=?"); query.setString(0, name); } return (Product) query.uniqueResult(); } // 按品牌名称查找品牌 public Product findProductByName(String name) throws Exception { Query query = null; Session session = this.getSession(); query = session.createQuery("from Product where name=?"); query.setString(0, name); return (Product)query.uniqueResult(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?