UserDao.java
资源名称:S2SH.rar [点击查看]
上传用户:greengl
上传日期:2017-12-31
资源大小:13653k
文件大小:1k
源码类别:
Ajax
开发平台:
Java
- package com.dao;
- import java.util.List;
- import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
- import com.entity.Users;
- public class UserDao extends HibernateDaoSupport {
- public Users findUserByNameAndPass(String username, String password) {
- Object[] params=new Object[]{username,password};
- List<Users> userList=(List<Users>)super.getHibernateTemplate().find("from Users as user where user.userName=? and user.password=? ",params);
- if(userList!=null&&userList.size()>=1){
- return userList.get(0);
- }
- return null;
- }
- }