logincrmemployeedao.java

来自「基于SSH (struts+spring+hibernate)框架设计的 C」· Java 代码 · 共 31 行

JAVA
31
字号
package com.csu.crm.login.dao;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.csu.crm.common.vo.CrmEmployee;

public class LoginCrmEmployeeDAO extends HibernateDaoSupport{
	
	public CrmEmployee findbyidandpass(String loginid,String pass){
		System.out.println("begin");
		CrmEmployee crmEmployee;
		List list = null;
		String hql="from CrmEmployee as crmemployee where crmemployee.loginId='"+loginid+"' and crmemployee.pwd='"+pass+"'";
		System.out.println("sdsd");
		list = this.getHibernateTemplate().find(hql);
		System.out.println("select is  ok");
		if(!list.isEmpty()){
			crmEmployee=(CrmEmployee)list.get(0);
			return crmEmployee;
		}
		return null;
	}
	public static LoginCrmEmployeeDAO getFromApplicationContext(
			ApplicationContext ctx) {
		return (LoginCrmEmployeeDAO) ctx.getBean("LoginCrmEmployeeDAO");
	}
}

⌨️ 快捷键说明

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