User.java
User.hbm.xml
Item.java
Item.hbm.xml
Subitem.java
Subitem.hbm.xml
Question.java
Question.hbm.xml
Answer.java
Answer.hbm.xml
Admin.java
Admin.hbm.xml
package org.lxh.myzngt.vo;
public class User {
/** sex property */
private String sex;
/** usermail property */
private String usermail;
/** userques property */
private String userques;
/** userid property */
private String userid;
/** realname property */
private String realname;
/** userans property */
private String userans;
/** userpwd property */
private String userpwd;
/** grade property */
private int grade;
/** integral property */
private int integral;
/** id property */
private int id;
public int getGrade() {
return grade;
}
public void setGrade(int grade) {
this.grade = grade;
}
public String getRealname() {
return realname;
}
public void setRealname(String realname) {
this.realname = realname;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getUserans() {
return userans;
}
public void setUserans(String userans) {
this.userans = userans;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public String getUsermail() {
return usermail;
}
public void setUsermail(String usermail) {
this.usermail = usermail;
}
public String getUserpwd() {
return userpwd;
}
public void setUserpwd(String userpwd) {
this.userpwd = userpwd;
}
public String getUserques() {
return userques;
}
public void setUserques(String userques) {
this.userques = userques;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getIntegral() {
return integral;
}
public void setIntegral(int integral) {
this.integral = integral;
}
}
User.hbm.xml
<?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">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="org.lxh.myzngt.vo.User" table="user">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="native"></generator>
</id>
<property name="userid" type="java.lang.String">
<column name="userid" length="50" not-null="true" />
</property>
<property name="userpwd" type="java.lang.String">
<column name="userpwd" length="50" />
</property>
<property name="userques" type="java.lang.String">
<column name="userques" length="50" />
</property>
<property name="userans" type="java.lang.String">
<column name="userans" length="50" />
</property>
<property name="usermail" type="java.lang.String">
<column name="usermail" length="50" />
</property>
<property name="integral" type="java.lang.Integer">
<column name="integral" />
</property>
<property name="grade" type="java.lang.Integer">
<column name="grade" />
</property>
<property name="sex" type="java.lang.String">
<column name="sex" length="2" />
</property>
<property name="realname" type="java.lang.String">
<column name="realname" length="50" />
</property>
</class>
</hibernate-mapping>
Item.java
package org.lxh.myzngt.vo;
import java.util.Set;
public class Item {
private int itemid ;
private String itemname ;
private int itemcode ;
private Set subitems ;
public int getItemcode() {
return itemcode;
}
public void setItemcode(int itemcode) {
this.itemcode = itemcode;
}
public int getItemid() {
return itemid;
}
public void setItemid(int itemid) {
this.itemid = itemid;
}
public String getItemname() {
return itemname;
}
public void setItemname(String itemname) {
this.itemname = itemname;
}
public Set getSubitems() {
return subitems;
}
public void setSubitems(Set subitems) {
this.subitems = subitems;
}
}
Item.hbm.xml
<?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">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="org.lxh.myzngt.vo.Item" table="item">
<id name="itemid" type="java.lang.Integer">
<column name="itemid" />
<generator class="native" />
</id>
<property name="itemname" type="java.lang.String">
<column name="itemname" length="50" />
</property>
<property name="itemcode" type="java.lang.Integer">
<column name="itemcode" />
</property>
<set name="subitems" inverse="true" cascade="all"
table="subitem" lazy="true" order-by="subcode">
<key>
<column name="itemid" />
</key>
<one-to-many class="org.lxh.myzngt.vo.Subitem" />
</set>
</class>
</hibernate-mapping>
Subitem.java
package org.lxh.myzngt.vo;
public class Subitem {
private int subid ;
private String subname ;
private String itemid ;
private int subcode ;
private Item item ;
public String getItemid() {
return itemid;
}
public void setItemid(String itemid) {
this.itemid = itemid;
}
public int getSubid() {
return subid;
}
public void setSubid(int subid) {
this.subid = subid;
}
public String getSubname() {
return subname;
}
public void setSubname(String subname) {
this.subname = subname;
}
public Item getItem() {
return item;
}
public void setItem(Item item) {
this.item = item;
}
public int getSubcode() {
return subcode;
}
public void setSubcode(int subcode) {
this.subcode = subcode;
}
}
Subitem.hbm.xml
<?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">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="org.lxh.myzngt.vo.Subitem" table="subitem">
<id name="subid" type="java.lang.Integer">
<column name="subid" />
<generator class="native" />
</id>
<many-to-one name="item" class="org.lxh.myzngt.vo.Item">
<column name="itemid" />
</many-to-one>
<property name="subname" type="java.lang.String">
<column name="subname" length="50" />
</property>
<property name="subcode" type="java.lang.Integer">
<column name="subcode" />
</property>
</class>
</hibernate-mapping>
Question.java
package org.lxh.myzngt.vo;
import java.util.Date;
import java.util.Set;
public class Question {
private int qid ;
private String title ;
private String content ;
private int itemid ;
private int subid ;
private String userid ;
private String grade ;
private int offerscore ;
private int status ;
private Date questiontime ;
private int clickcount ;
private int acceptflag ;
private int commenflag ;
private Set answers ;
public int getAcceptflag() {
return acceptflag;
}
public void setAcceptflag(int acceptflag) {
this.acceptflag = acceptflag;
}
public int getClickcount() {
return clickcount;
}
public void setClickcount(int clickcount) {
this.clickcount = clickcount;
}
public int getCommenflag() {
return commenflag;
}
public void setCommenflag(int commenflag) {
this.commenflag = commenflag;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public int getItemid() {
return itemid;
}
public void setItemid(int itemid) {
this.itemid = itemid;
}
public int getOfferscore() {
return offerscore;
}
public void setOfferscore(int offerscore) {
this.offerscore = offerscore;
}
public int getQid() {
return qid;
}
public void setQid(int qid) {
this.qid = qid;
}
public Date getQuestiontime() {
return questiontime;
}
public void setQuestiontime(Date questiontime) {
this.questiontime = questiontime;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getSubid() {
return subid;
}
public void setSubid(int subid) {
this.subid = subid;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public Set getAnswers() {
return answers;
}
public void setAnswers(Set answers) {
this.answers = answers;
}
public String getGrade() {
return grade;
}
public void setGrade(String grade) {
this.grade = grade;
}
}
Question.hbm.xml
<?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">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="org.lxh.myzngt.vo.Question" table="question">
<id name="qid" type="java.lang.Integer">
<column name="qid" />
<generator class="native" />
</id>
<property name="title" type="java.lang.String">
<column name="title" length="50" />
</property>
<property name="content" type="java.lang.String">
<column name="content" length="65535" />
</property>
<property name="itemid" type="java.lang.Integer">
<column name="itemid" />
</property>
<property name="subid" type="java.lang.Integer">
<column name="subid" />
</property>
<property name="userid" type="java.lang.String">
<column name="userid" length="50" />
</property>
<property name="grade" type="java.lang.String">
<column name="grade" length="50" />
</property>
<property name="offerscore" type="java.lang.Integer">
<column name="offerscore" />
</property>
<property name="status" type="java.lang.Integer">
<column name="status" />
</property>
<property name="questiontime" type="java.util.Date">
<column name="questiontime" length="19" />
</property>
<property name="clickcount" type="java.lang.Integer">
<column name="clickcount" />
</property>
<property name="acceptflag" type="java.lang.Integer">
<column name="acceptflag" />
</property>
<property name="commenflag" type="java.lang.Integer">
<column name="commenflag" />
</property>
<set name="answers" inverse="true" table="answer">
<key>
<column name="qid" />
</key>
<one-to-many class="org.lxh.myzngt.vo.Answer" />
</set>
</class>
</hibernate-mapping>
Answer.java
package org.lxh.myzngt.vo;
import java.util.Date;
public class Answer {
private int aid ;
private String quesans ;
private String userid ;
private String grade ;
private Date anstime ;
private int status ;
private int qid ;
private Question question ;
public int getAid() {
return aid;
}
public void setAid(int aid) {
this.aid = aid;
}
public Date getAnstime() {
return anstime;
}
public void setAnstime(Date anstime) {
this.anstime = anstime;
}
public int getQid() {
return qid;
}
public void setQid(int qid) {
this.qid = qid;
}
public String getQuesans() {
return quesans;
}
public void setQuesans(String quesans) {
this.quesans = quesans;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public Question getQuestion() {
return question;
}
public void setQuestion(Question question) {
this.question = question;
}
public String getGrade() {
return grade;
}
public void setGrade(String grade) {
this.grade = grade;
}
}
Answer.hbm.xml
<?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">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="org.lxh.myzngt.vo.Answer" table="answer">
<id name="aid" type="java.lang.Integer">
<column name="aid" />
<generator class="native" />
</id>
<many-to-one name="question" class="org.lxh.myzngt.vo.Question"
fetch="select">
<column name="qid" />
</many-to-one>
<property name="quesans" type="java.lang.String">
<column name="quesans" length="50" />
</property>
<property name="userid" type="java.lang.String">
<column name="userid" length="50" />
</property>
<property name="grade" type="java.lang.String">
<column name="grade" length="50" />
</property>
<property name="anstime" type="java.util.Date">
<column name="anstime" length="19" />
</property>
<property name="status" type="java.lang.Integer">
<column name="status" />
</property>
</class>
</hibernate-mapping>
Admin.java
package org.lxh.myzngt.vo;
public class Admin {
private int id ;
private String adminid ;
private String adminpwd ;
public String getAdminid() {
return adminid;
}
public void setAdminid(String adminid) {
this.adminid = adminid;
}
public String getAdminpwd() {
return adminpwd;
}
public void setAdminpwd(String adminpwd) {
this.adminpwd = adminpwd;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
Admin.hbm.xml
<?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">
<!--
Mapping file autogenerated by MyEclipse - Hibernate Tools
-->
<hibernate-mapping>
<class name="org.lxh.myzngt.vo.Admin" table="admin">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="native" />
</id>
<property name="adminid" type="java.lang.String">
<column name="adminid" length="50" not-null="true" />
</property>
<property name="adminpwd" type="java.lang.String">
<column name="adminpwd" length="50" />
</property>
</class>
</hibernate-mapping>