package com.zbaccp.ea.dao.impl;
import java.util.Date;
import java.util.List;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.LockMode;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.zbaccp.ea.entity.Students;
/**
* A data access object (DAO) providing persistence and search support for
* Students entities. Transaction control of the save(), update() and delete()
* operations can directly support Spring container-managed transactions or they
* can be augmented to handle user-managed Spring transactions. Each of these
* methods provides additional information for how to configure it for the
* desired type of transaction control.
*
* @see com.zbaccp.ea.entity.Students
* @author MyEclipse Persistence Tools
*/
public class StudentsDAO extends HibernateDaoSupport {
private static final Log log = LogFactory.getLog(StudentsDAO.class);
// property constants
public static final String NUMBER = "number";
public static final String NAME = "name";
public static final String SEX = "sex";
public static final String QUALIFICATION = "qualification";
public static final String TELEPHONE = "telephone";
public static final String ADDRESS = "address";
public static final String STATE = "state";
public static final String REMARK = "remark";
protected void initDao() {
// do nothing
}
public void save(Students transientInstance) {
log.debug("saving Students instance");
try {
getHibernateTemplate().save(transientInstance);
log.debug("save successful");
} catch (RuntimeException re) {
log.error("save failed", re);
throw re;
}
}
public void delete(Students persistentInstance) {
log.debug("deleting Students instance");
try {
getHibernateTemplate().delete(persistentInstance);
log.debug("delete successful");
} catch (RuntimeException re) {
log.error("delete failed", re);
throw re;
}
}
public Students findById(java.lang.String id) {
log.debug("getting Students instance with id: " + id);
try {
Students instance = (Students) getHibernateTemplate().get(
"com.zbaccp.ea.entity.Students", id);
return instance;
} catch (RuntimeException re) {
log.error("get failed", re);
throw re;
}
}
public List findByExample(Students instance) {
log.debug("finding Students 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;
}
}
public List findByProperty(String propertyName, Object value) {
log.debug("finding Students instance with property: " + propertyName
+ ", value: " + value);
try {
String queryString = "from Students as model where model."
+ propertyName + "= ?";
return getHibernateTemplate().find(queryString, value);
} catch (RuntimeException re) {
log.error("find by property name failed", re);
throw re;
}
}
public List findByNumber(Object number) {
return findByProperty(NUMBER, number);
}
public List findByName(Object name) {
return findByProperty(NAME, name);
}
public List findBySex(Object sex) {
return findByProperty(SEX, sex);
}
public List findByQualification(Object qualification) {
return findByProperty(QUALIFICATION, qualification);
}
public List findByTelephone(Object telephone) {
return findByProperty(TELEPHONE, telephone);
}
public List findByAddress(Object address) {
return findByProperty(ADDRESS, address);
}
public List findByState(Object state) {
return findByProperty(STATE, state);
}
public List findByRemark(Object remark) {
return findByProperty(REMARK, remark);
}
public List findAll() {
log.debug("finding all Students instances");
try {
String queryString = "from Students";
return getHibernateTemplate().find(queryString);
} catch (RuntimeException re) {
log.error("find all failed", re);
throw re;
}
}
public Students merge(Students detachedInstance) {
log.debug("merging Students instance");
try {
Students result = (Students) getHibernateTemplate().merge(
detachedInstance);
log.debug("merge successful");
return result;
} catch (RuntimeException re) {
log.error("merge failed", re);
throw re;
}
}
public void attachDirty(Students instance) {
log.debug("attaching dirty Students instance");
try {
getHibernateTemplate().saveOrUpdate(instance);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public void attachClean(Students instance) {
log.debug("attaching clean Students instance");
try {
getHibernateTemplate().lock(instance, LockMode.NONE);
log.debug("attach successful");
} catch (RuntimeException re) {
log.error("attach failed", re);
throw re;
}
}
public static StudentsDAO getFromApplicationContext(ApplicationContext ctx) {
return (StudentsDAO) ctx.getBean("StudentsDAO");
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ea.rar_教务_教务管理_教务管理系统_教务系统java_管理系统 (138个子文件)
StudentsDAO.class 6KB
EmployeedetailsDAO.class 6KB
AttendancestatusesDAO.class 6KB
AttendancestatusesDAO.class 6KB
StudentexaminedetailsDAO.class 6KB
StudentexaminesDAO.class 6KB
MessagesDAO.class 6KB
StudentattendancedetailsDAO.class 6KB
StudentattendancesDAO.class 6KB
ClassstatesDAO.class 5KB
EmployeesDAO.class 5KB
ClasstypeDAO.class 5KB
MessagetousersDAO.class 5KB
ClassesDAO.class 5KB
CoursesDAO.class 5KB
RolesDAO.class 5KB
TermsDAO.class 5KB
SchoolteachingsDAO.class 5KB
EmployeerolesDAO.class 5KB
Students.class 4KB
Employees.class 4KB
Classes.class 3KB
Employeedetails.class 3KB
Messages.class 2KB
Schoolteachings.class 2KB
Studentexamines.class 2KB
Terms.class 2KB
Studentattendances.class 2KB
Attendancestatuses.class 2KB
Roles.class 2KB
Classstates.class 2KB
Classtype.class 2KB
Messagetousers.class 2KB
Courses.class 2KB
Studentexaminedetails.class 1KB
Studentattendancedetails.class 1KB
Employeeroles.class 1KB
IAttendancestatusesDao.class 747B
.classpath 6KB
StudentsDAO.java 5KB
EmployeedetailsDAO.java 5KB
AttendancestatusesDAO.java 5KB
AttendancestatusesDAO.java 5KB
StudentexaminedetailsDAO.java 5KB
StudentexaminesDAO.java 5KB
StudentattendancedetailsDAO.java 5KB
StudentattendancesDAO.java 5KB
MessagesDAO.java 4KB
ClassstatesDAO.java 4KB
EmployeesDAO.java 4KB
ClasstypeDAO.java 4KB
MessagetousersDAO.java 4KB
ClassesDAO.java 4KB
SchoolteachingsDAO.java 4KB
CoursesDAO.java 4KB
RolesDAO.java 4KB
TermsDAO.java 4KB
EmployeerolesDAO.java 4KB
Employees.java 3KB
Students.java 3KB
Employeedetails.java 3KB
Classes.java 2KB
Messages.java 2KB
Schoolteachings.java 2KB
Attendancestatuses.java 2KB
Terms.java 1KB
Studentexamines.java 1KB
Roles.java 1KB
Classstates.java 1KB
Studentattendances.java 1KB
Classtype.java 1KB
Messagetousers.java 1KB
Courses.java 1KB
Studentattendancedetails.java 1KB
Studentexaminedetails.java 1KB
Employeeroles.java 938B
IAttendancestatusesDao.java 876B
login.jsp 834B
.struts-config.mex 76B
MANIFEST.MF 39B
.myhibernatedata 460B
.mymetadata 279B
.mystrutsdata 257B
.project 2KB
log4j.properties 805B
log4j.properties 805B
ApplicationResources.properties 80B
ApplicationResources.properties 80B
.springBeans 320B
struts-html.tld 72KB
struts-nested.tld 70KB
spring-form.tld 51KB
struts-logic.tld 14KB
spring.tld 13KB
struts-bean.tld 9KB
struts-tiles.tld 8KB
www.pudn.com.txt 218B
validator-rules.xml 13KB
applicationContext.xml 5KB
applicationContext.xml 5KB
共 138 条
- 1
- 2
资源评论
- hzc20022023-11-14资源太好了,解决了我当下遇到的难题,抱紧大佬的大腿~
御道御小黑
- 粉丝: 58
- 资源: 1万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功