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

📄 accountinfodaoimpl.java

📁 基于Struts+Hibernate+Spring+Ajax技术开发一个简单的影院在线订票系统
💻 JAVA
字号:
package com.accp.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.accp.dao.AccountinfoDao;
import com.accp.entity.Accountinfo;

public class AccountinfoDaoImpl extends BaseDao implements AccountinfoDao {

	@Override
	public List getAccountinfo(final Accountinfo accountinfo) {
		// TODO Auto-generated method stub
		List list = null;
		list = super.getHibernateTemplate().executeFind(new HibernateCallback() {

			@Override
			public Object doInHibernate(Session s)
					throws HibernateException, SQLException {
				// TODO Auto-generated method stub
				List list = s.createQuery("from Accountinfo a where a.account = :account and a.psw = :psw")
				.setString("account", accountinfo.getAccount())
				.setString("psw", accountinfo.getPsw())
				.list();
				return list;
			}});
		return list;
	}
}

⌨️ 快捷键说明

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