1.

 package com.sanqing.po;
/*
* 学生表,保存学生编号,系统密码
*/
public class Student {
private String studentID;
private String password;
private String studentName;
private Integer result;
private String sclass;
public String getStudentID() {
return studentID;
}
public void setStudentID(String studentID) {
this.studentID = studentID;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getStudentName() {
return studentName;
}
public void setStudentName(String studentName) {
this.studentName = studentName;
}
public Integer getResult() {
return result;
}
public void setResult(Integer result) {
this.result = result;
}
public String getSclass() {
return sclass;
}
public void setSclass(String sclass) {
this.sclass = sclass;
}
}

2.

 <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.sanqing.po.Student" table="tb_student"><!-- 每个class对应一个持久化对象 -->
<id name="studentID" type="string"><!-- id元素用来定义主键标识,并指定主键生成策略 -->
<generator class="assigned"></generator>
</id>
<property name="password"></property><!-- 映射password属性 -->
<property name="studentName"></property><!-- 映射studentName属性 -->
<property name="result"></property><!-- 映射result属性 -->
<property name="sclass"></property><!-- 映射sclass属性 -->
</class>
</hibernate-mapping>

3.

 package com.sanqing.po;
/*
* 题目类
*/
public class Subject {
private int subjectID;
private String subjectTitle;
private String subjectOptionA;
private String subjectOptionB;
private String subjectOptionC;
private String subjectOptionD;
private String subjectAnswer;
private String subjectParse;
public int getSubjectID() {
return subjectID;
}
public void setSubjectID(int subjectID) {
this.subjectID = subjectID;
}
public String getSubjectTitle() {
return subjectTitle;
}
public void setSubjectTitle(String subjectTitle) {
this.subjectTitle = subjectTitle;
}
public String getSubjectOptionA() {
return subjectOptionA;
}
public void setSubjectOptionA(String subjectOptionA) {
this.subjectOptionA = subjectOptionA;
}
public String getSubjectOptionB() {
return subjectOptionB;
}
public void setSubjectOptionB(String subjectOptionB) {
this.subjectOptionB = subjectOptionB;
}
public String getSubjectOptionC() {
return subjectOptionC;
}
public void setSubjectOptionC(String subjectOptionC) {
this.subjectOptionC = subjectOptionC;
}
public String getSubjectOptionD() {
return subjectOptionD;
}
public void setSubjectOptionD(String subjectOptionD) {
this.subjectOptionD = subjectOptionD;
}
public String getSubjectAnswer() {
return subjectAnswer;
}
public void setSubjectAnswer(String subjectAnswer) {
this.subjectAnswer = subjectAnswer;
}
public String getSubjectParse() {
return subjectParse;
}
public void setSubjectParse(String subjectParse) {
this.subjectParse = subjectParse;
}
}

4.

 <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.sanqing.po.Subject" table="tb_subject"><!-- 每个class对应一个持久化对象 -->
<id name="subjectID"><!-- id元素用来定义主键标识,并指定主键生成策略 -->
<generator class="identity"></generator>
</id>
<property name="subjectTitle"></property> <!-- 映射subjectTitle属性 -->
<property name="subjectOptionA"></property> <!-- 映射subjectOptionA属性 -->
<property name="subjectOptionB"></property> <!-- 映射subjectOptionB属性 -->
<property name="subjectOptionC"></property> <!-- 映射subjectOptionC属性 -->
<property name="subjectOptionD"></property> <!-- 映射subjectOptionD属性 -->
<property name="subjectAnswer"></property> <!-- 映射subjectAnswer属性 -->
<property name="subjectParse"></property> <!-- 映射subjectParse属性 -->
</class>
</hibernate-mapping>

5.

 package com.sanqing.po;

 public class Teacher {
private String teacherID;
private String password;
public String getTeacherID() {
return teacherID;
}
public void setTeacherID(String teacherID) {
this.teacherID = teacherID;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}

6.

 <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.sanqing.po.Teacher" table="tb_teacher"><!-- 每个class对应一个持久化对象 -->
<id name="teacherID" type="string"><!-- id元素用来定义主键标识,并指定主键生成策略 -->
<generator class="assigned"></generator>
</id>
<property name="password"></property><!-- 映射password属性 -->
</class>
</hibernate-mapping>

JavaWeb项目开发案例精粹-第3章在线考试系统-006实体层的更多相关文章

  1. JavaWeb项目开发案例精粹-第3章在线考试系统-007View层

    0.login.jsp <%@ page language="java" import="java.util.*" pageEncoding=" ...

  2. JavaWeb项目开发案例精粹-第3章在线考试系统-005action层

    1. <?xml version="1.0" encoding="UTF-8" ?><!-- XML声明 --> <!DOCTYP ...

  3. JavaWeb项目开发案例精粹-第3章在线考试系统-004Service层

    1. package com.sanqing.service; import java.util.List; import com.sanqing.po.Student; public interfa ...

  4. JavaWeb项目开发案例精粹-第3章在线考试系统-003Dao层

    1. package com.sanqing.dao; import java.util.List; import com.sanqing.po.Student; public interface S ...

  5. JavaWeb项目开发案例精粹-第3章在线考试系统-002配置文件及辅助类

    1. <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5&qu ...

  6. JavaWeb项目开发案例精粹-第3章在线考试系统-001设计

    1. 2. 3. 4. # MySQL-Front 5.0 (Build 1.0) /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */; /*!40101 SET SQL ...

  7. JavaWeb项目开发案例精粹-第6章报价管理系统-05Action层

    0. <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC &quo ...

  8. JavaWeb项目开发案例精粹-第6章报价管理系统-002辅助类及配置文件

    1. <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www ...

  9. JavaWeb项目开发案例精粹-第2章投票系统-001设计

    1.项目结构 2.数据库设计 # MySQL-Front 5.0 (Build 1.0) /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE */; /*!40101 SET ...

随机推荐

  1. jQuery对Select操作大集合

    介绍了jQuery对Select的操作进行了详细的汇总. 1.jQuery添加/删除Select的Option项: 2.$("#select_id").append("& ...

  2. CentOS设置服务开机启动的方法

    CentOS设置服务开机启动的两种方法 1.利用 chkconfig 来配置启动级别在CentOS或者RedHat其他系统下,如果是后面安装的服务,如httpd.mysqld.postfix等,安装后 ...

  3. C#学习笔记一

    c#学习笔记一 c#学习笔记一    1 1.    注释    3 1.1.    ///是文档注释,用于类和方法的说明    3 1.2.    #region #endregion可以折叠代码  ...

  4. linux c 验证登录密码

    #define _XOPEN_SOURCE #include <stdio.h> #include <unistd.h> int main(int argc, char *ar ...

  5. EntityFramework中的datetime2异常的解决

    (转)   最近使用.net的Entity Framework构建网站数据层,给一个实体的DATETIME类型的属性赋值时 突然莫名奇妙显示有一个类型不匹配的异常如下: System.Data.Sql ...

  6. Asp.Net MVC使用ViewData导致双引号被转义的解决方法

    使用以下方法进行输出 @Html.Raw(ViewData["jsonString"].ToString())

  7. 【个人笔记】003-PHP基础-01-PHP快速入门-03-PHP环境搭建

    003-PHP基础-01-PHP快速入门 03-PHP环境搭建 1.客户端(浏览器) IE FireFox CHROME Opera Safari 2.服务器 是运行网站的基本 是放置程序代码的地方 ...

  8. Get current time and date on Android

    You could use: Calendar c =Calendar.getInstance();int seconds = c.get(Calendar.SECOND); There are pl ...

  9. iOS xcode 8 注释快捷键

    单行注释:在方法的地方按 Command+/ 标注的功能,快捷键是Command + Option + / 需要在方法名的上面(空白)的地方按 Command + Option + /      才管 ...

  10. Jquery datatables 重载数据方法

    参考这里 { RefreshTable('#table-example', '/BlogManage/GetLabelData'); } function RefreshTable(tableId, ...