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

📄 surveychildcountdaoimpl.java

📁 简单的网上调查系统。采用Spring+Hibernate方式设计架构。
💻 JAVA
字号:
package com.mySurvey.dao.impl;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.mySurvey.bean.SurveyChildCount;
import com.mySurvey.bean.SurveyOption;
import com.mySurvey.dao.SurveyChildCountDAO;

public class SurveyChildCountDAOImpl extends HibernateDaoSupport implements SurveyChildCountDAO {
	private SessionFactory sessionFactory;
	private String hql = "from SurveyChildCount u where u.surveyChildId = ?";
    public SurveyChildCount query(SurveyChildCount surveyChildCount) {
    	SurveyChildCount surveyChildCount1 = null;
    	//如果查询结果为空
		if (this.getHibernateTemplate().find(hql, surveyChildCount.getSurveyChildId()) == null || this.getHibernateTemplate().find(hql, surveyChildCount.getSurveyChildId()).size() == 0) {
			surveyChildCount1 = null;
		} else {
			//不为空时,取第一笔
			surveyChildCount1 = (SurveyChildCount)(this.getHibernateTemplate().find(hql, surveyChildCount.getSurveyChildId()).get(0));
		}
		return surveyChildCount1;
    }
    //新增调查结果
	public void insert(SurveyChildCount surveyChildCount) {
		this.getHibernateTemplate().save(surveyChildCount);
	}
	//修改调查结果
	public void update(SurveyChildCount surveyChildCount) {
		this.getHibernateTemplate().update(surveyChildCount);
	}
	//删除调查结果
	public void delete(SurveyChildCount surveyChildCount) {
		this.getHibernateTemplate().delete(surveyChildCount);
	}
}

⌨️ 快捷键说明

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