questionpaperservice.java

来自「在线考试系统: 这是基于struts和Hibernate的最新技术的在线考试系」· Java 代码 · 共 34 行

JAVA
34
字号
package com.zjxy.service;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.Session;

import com.zjxy.hibernate.HibernateSessionFactory;
import com.zjxy.hibernate.model.QuestionPaper;

public class QuestionPaperService {

	public static QuestionPaper getPaperById(String id){
		QuestionPaper paper=new QuestionPaper();
		Session s=HibernateSessionFactory.currentSession();
		paper=(QuestionPaper)s.get(QuestionPaper.class,Integer.valueOf(id));
		HibernateSessionFactory.closeSession();
		return paper;
		
	}
	
	
	public static List temlist(int id){
		List list=new ArrayList();
		Session s=HibernateSessionFactory.currentSession();
		String hql="from ExamForward where questionpaper.sequenceID="+id+" order by questionNo";
		list=s.createQuery(hql).list();
		
		HibernateSessionFactory.closeSession();
		return list;
		
	}
}

⌨️ 快捷键说明

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