package com.star.ajaxtest.dao.impl;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.hibernate.Session;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.star.ajaxtest.dao.IUserTableDAO;
import com.star.ajaxtest.entity.UserTable;
public class UserTableDAOImpl extends HibernateDaoSupport implements IUserTableDAO {
private static final Log log = LogFactory.getLog(UserTableDAOImpl.class);
protected void initDao() {
// do nothing
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#save(com.star.ajaxtest.entity.UserTable)
*/
public Integer save(UserTable transientInstance) {
log.debug("saving UserTable instance");
Integer uid = null;
try {
uid = (Integer) getHibernateTemplate().save(transientInstance);
log.debug("save successful");
return uid;
} catch (RuntimeException re) {
log.error("save failed", re);
return uid;
}
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#delete(com.star.ajaxtest.entity.UserTable)
*/
public void delete(UserTable persistentInstance) {
log.debug("deleting UserTable instance");
try {
getHibernateTemplate().delete(persistentInstance);
log.debug("delete successful");
} catch (RuntimeException re) {
log.error("delete failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#findById(java.lang.Integer)
*/
public UserTable findById(java.lang.Integer id) {
log.debug("getting UserTable instance with id: " + id);
try {
UserTable instance = (UserTable) getHibernateTemplate().get(
"com.star.ajaxtest.entity.UserTable", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#findByExample(com.star.ajaxtest.entity.UserTable)
*/
public List findByExample(UserTable instance) {
log.debug("finding UserTable instance by example");
try {
List results = getHibernateTemplate().findByExample(instance);
log.debug("find by example successful, result size: "
+ results.size());
return results;
} catch (RuntimeException re) {
log.error("find by example failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#findByProperty(java.lang.String, java.lang.Object)
*/
public List findByProperty(String propertyName, Object value) {
log.debug("finding UserTable instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from UserTable as model where model."
+ propertyName + "= ?";
return getHibernateTemplate().find(queryString, value);
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#findByUserName(java.lang.Object)
*/
public List findByUserName(Object userName) {
return findByProperty(USER_NAME, userName);
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#findByPassword(java.lang.Object)
*/
public List findByPassword(Object password) {
return findByProperty(PASSWORD, password);
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#findAll()
*/
public List findAll() {
log.debug("finding all UserTable instances");
try {
String queryString = "from UserTable";
return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#merge(com.star.ajaxtest.entity.UserTable)
*/
public UserTable merge(UserTable detachedInstance) {
log.debug("merging UserTable instance");
try {
UserTable result = (UserTable) getHibernateTemplate().merge(
detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#attachDirty(com.star.ajaxtest.entity.UserTable)
*/
public void attachDirty(UserTable instance) {
log.debug("attaching dirty UserTable instance");
try {
getHibernateTemplate().saveOrUpdate(instance);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
/* (non-Javadoc)
* @see com.star.ajaxtest.dao.IUserTableDAO#attachClean(com.star.ajaxtest.entity.UserTable)
*/
public void attachClean(UserTable instance) {
log.debug("attaching clean UserTable instance");
try {
getHibernateTemplate().lock(instance, LockMode.NONE);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
/**
* 查询用户输入的用户名是否存在
* @param ctx
* @return
*/
/*public UserTable findByUserName(String uname){
String hql = "from UserTable where userName=?";
Session session = this.getSession();
}
*/
public static IUserTableDAO getFromApplicationContext(ApplicationContext ctx) {
return (IUserTableDAO) ctx.getBean("UserTableDAO");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架)
共88个文件
jar:43个
xml:8个
tld:7个
4星 · 超过85%的资源 需积分: 13 229 下载量 39 浏览量
2010-10-20
15:49:52
上传
评论 5
收藏 11.65MB RAR 举报
温馨提示
AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架) AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架) AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架)
资源推荐
资源详情
资源评论
收起资源包目录
AJAXText_UserLogin.rar (88个子文件)
AJAXText_UserLogin
AjaxTest
.mystrutsdata 257B
hibernate.reveng.xml 432B
.springBeans 479B
.myhibernatedata 538B
.settings
org.eclipse.jdt.core.prefs 334B
src
com
star
ajaxtest
dao
IUserTableDAO.java 931B
impl
UserTableDAOImpl.java 5KB
ApplicationResources.properties 86B
form
UserForm.java 800B
action
UserAction.java 1KB
service
IUserService.java 441B
impl
UserServiceImpl.java 941B
entity
UserTable.hbm.xml 840B
UserTable.java 913B
.project 2KB
WebRoot
META-INF
MANIFEST.MF 39B
WEB-INF
struts-nested.tld 63KB
struts-template.tld 2KB
validator-rules.xml 41KB
struts-bean.tld 9KB
struts-html.tld 65KB
struts-logic.tld 14KB
struts-tiles.tld 8KB
web.xml 2KB
dwr.xml 347B
.struts-config.mex 168B
classes
com
star
ajaxtest
dao
IUserTableDAO.class 890B
impl
UserTableDAOImpl.class 6KB
ApplicationResources.properties 86B
form
UserForm.class 1KB
action
UserAction.class 2KB
service
IUserService.class 407B
impl
UserServiceImpl.class 2KB
entity
UserTable.class 1KB
UserTable.hbm.xml 840B
struts-config.xml 870B
lib
spring-webmvc.jar 207KB
log4j-1.2.14.jar 359KB
sqljdbc.jar 570KB
commons-logging-1.0.4.jar 37KB
jaas.jar 102KB
commons-beanutils.jar 184KB
xml-apis.jar 121KB
velocity-1.4.jar 353KB
jta.jar 9KB
commons-collections.jar 546KB
itext-1.3.jar 1.09MB
log4j-1.2.9.jar 344KB
commons-attributes-api.jar 35KB
commons-fileupload.jar 22KB
commons-digester-1.8.jar 140KB
spring-beans.jar 228KB
ehcache-1.1.jar 46KB
antlr-2.7.5H3.jar 423KB
spring-core.jar 123KB
spring-context.jar 108KB
commons-httpclient.jar 273KB
velocity-tools-view-1.2.jar 67KB
commons-collections-2.1.1.jar 171KB
asm.jar 26KB
dwr.jar 478KB
commons-logging.jar 37KB
jaxen-1.1-beta-4.jar 233KB
velocity-tools-generic-1.2.jar 18KB
xerces-2.6.2.jar 987KB
cglib-2.1.jar 275KB
asm-attrs.jar 16KB
jasperreports-1.0.3.jar 843KB
commons-attributes-compiler.jar 29KB
freemarker.jar 784KB
jdbc2_0-stdext.jar 7KB
cos.jar 55KB
commons-lang.jar 203KB
poi-2.5.1.jar 783KB
jakarta-oro-2.0.8.jar 64KB
jxl.jar 597KB
dom4j-1.6.jar 306KB
spring-web.jar 140KB
hibernate3.jar 1.6MB
spring.tld 8KB
applicationContext.xml 2KB
index.jsp 2KB
error.jsp 824B
success.jsp 835B
.mymetadata 297B
.classpath 4KB
.myeclipse
data
J2EE_test_log.ldf 1024KB
J2EE_test.mdf 5MB
共 88 条
- 1
偽僾訫誶
- 粉丝: 2
- 资源: 37
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- xyctf:从入门到精通的实用指南.zip
- mmqrcode1714153659780.png
- Screenshot_2024-04-27-06-08-58-486_com.baidu.xin.aiqicha.jpg
- 基于Javaweb+Tomcat+MySQL的大学生公寓管理系统+sql文件.zip
- 实训作业基于javaweb的订单管理系统源码+数据库+实训报告.zip
- 多机调度问题贪心算法基于最小堆和贪心算法求解多机调度问题.zip
- 基于同态加密技术的匿名电子投票系统源码.zip
- Pyqt5项目框架-PyQt项目开发实践
- 基于C通过MQTT的智能农业大棚管理系统(本科毕业设计)
- python+CNN的网络入侵检测算法源码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
前往页