src/com/dao/PunishmentDAO.java
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.dao;
import java.util.List;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.entity.PunishmentEntity;
public class PunishmentDAO extends HibernateDaoSupport {
public static PunishmentDAO getFromApplicationContext(ApplicationContext ctx) {
return (PunishmentDAO) ctx.getBean("punishmentDAO");
}
public void save(PunishmentEntity punishment) {
try {
super.getHibernateTemplate().save(punishment);
} catch (RuntimeException re) {
throw re;
}
}
public void update(PunishmentEntity punishment) {
try {
super.getHibernateTemplate().update(punishment);
} catch (RuntimeException re) {
throw re;
}
}
public void delete(PunishmentEntity punishment) {
try {
super.getHibernateTemplate().delete(punishment);
} catch (RuntimeException re) {
throw re;
}
}
public void delete(int id) {
try {
super.getHibernateTemplate().delete(getHibernateTemplate().get("com.entity.PunishmentEntity", id));
} catch (RuntimeException re) {
throw re;
}
}
public void delete(String id) {
try {
super.getHibernateTemplate().delete(getHibernateTemplate().get("com.entity.PunishmentEntity", id));
} catch (RuntimeException re) {
throw re;
}
}
@SuppressWarnings("unchecked")
public List<PunishmentEntity> show() {
try {
return super.getHibernateTemplate().find("From PunishmentEntity");
} catch (RuntimeException re) {
throw re;
}
}
@SuppressWarnings("unchecked")
public List<PunishmentEntity> queryByStudentid(String name) {
try {
return super.getHibernateTemplate().find("From PunishmentEntity where studentid = ?", name);
} catch (RuntimeException re) {
throw re;
}
}
后面还有 91 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。