无意义-wd5

来源:互联网 发布:最好网络质量测试工具 编辑:程序博客网 时间:2024/05/16 12:42

Aear.java

 

 

package

 

com.hzau.information.domain;

 

 

 

 

 

 

 

 

 

 

 

 

 

import

 

 

java.util.Date;

import

 

 

java.util.List;

 

public

 

 

class

Area {

 

 

private Long id

;

 

 

private String name

;

 

 

private List<Topic> topics

;

 

 

private int topicCount

;

 

 

private Date setupDate

;

 

 

 

public void

setSetupDate(Date setup){

 

 

this.setupDate

=setup;

}

 

 

public

Date getSetupDate(){

 

 

return this.setupDate

;

}

 

 

 

public void setTopicCount(int

topicCount){

 

 

this.topicCount

=topicCount;

}

 

 

public int

getTopicCount(){

 

 

return this.topicCount

;

}

 

 

 

public void

setTopics(List<Topic> topics){

 

 

this.topics

=topics;

}

 

 

public

List<Topic> getTopics(){

 

 

return this.topics

;

}

 

 

public void

setId(Long id){

 

 

this.id

=id;

}

 

 

public

Long getId(){

 

 

return this.id

;

}

 

 

 

public void

setName(String name){

 

 

this.name

=name;

}

 

 

public

String getName(){

 

 

return this.name

;

 }

 

 

 

Comment.java

 

 

 

 

 

 

 

 

 

 

 

package

 

 

com.hzau.information.domain;

 

import

 

 

java.util.Date;

 

public

 

 

class

Comment {

 

 

private

Long id;

// private Long postId;

 

 

private

Long userId;

 

 

private

Date issueTime;

 

 

private

String content;

 

 

 

 

public

String getContent(){

 

 

return this

.content;

}

 

 

public void

setContent(String content){

 

 

this

.content=content;

}

 

 

public void

setUserId(Long user){

 

 

this

.userId=user;

}

 

 

public

Long getUserId(){

 

 

return this

.userId;

}

 

 

 

public void

setIssueTime(Date date){

 

 

this

.issueTime=date;

}

 

 

 

public

Date getIssueTime(){

 

 

return this

.issueTime;

}

 

 

public void

setId(Long id){

 

 

this

.id=id;

}

 

 

public

Long getId(){

 

 

return this

.id;

}

 

// public void setPostId(Long post){

// this.postId=post;

// }

//

// public Long getPostId(){

// return this.postId;

// }

}

 

 

PersonalProfile.java

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

package

 

 

com.hzau.information.domain;

 

import

 

 

java.util.Date;

import

 

 

java.util.List;

 

 

public

 

 

class

PersonalProfile {

 

 

private Long id

;

 

 

private String name

;

 

 

private String nickName

;

 

 

private String age;

//delete

 

 

private String gender

;

 

 

private String email

;

 

 

private Date birthday

;

 

 

private String cellPhone

;

 

 

private String address

;

 

 

private String homePhone

;

 

 

private String college

;

 

 

private String job

;

 

 

private Long salary

;

 

 

private String qq

;

 

 

private String msn

;

 

 

private List<String> interests;

//delete

 

 

private String iconUrl

;

 

 

 

public void

setIconUrl(String url){

 

 

this.iconUrl

=url;

}

 

 

public

String getIconUrl(){

 

 

return this.iconUrl

;

}

 

 

public void

setInterests(List<String> inte){

 

 

this.interests

=inte;

}

 

 

public

List<String> getInterests(){

 

 

return this.interests

;

}

 

 

public

String getMsn(){

 

 

return this.msn

;

}

 

 

public void

setMsn(String msn){

 

 

this.msn

=msn;

}

 

 

public

String getQq(){

 

 

return qq

;

}

 

 

public void

setQq(String qq){

 

 

this.qq

=qq;

}

 

 

public

Long getSalary(){

 

 

return this.salary

;

}

 

 

public void

setSalary(Long salary){

 

 

this.salary

=salary;

}

 

 

public void

setJob(String job){

 

 

this.job

=job;

}

 

 

public

String getJob(){

 

 

return this.job

;

}

 

 

public void

setCollege(String college){

 

 

this.college

=college;

}

 

 

public

String getCollege(){

 

 

return this.college

;

}

 

 

public void

setHomePhone(String homePhone){

 

 

this.homePhone

=homePhone;

}

 

 

public

String getHomePhone(){

 

 

return this.homePhone

;

}

 

 

public

String getAddress(){

 

 

return this.address

;

}

 

 

public void

setAddress(String address){

 

 

this.address

=address;

}

 

 

 

public void

setCellPhone(String cp){

 

 

this.cellPhone

=cp;

}

 

 

public

String getCellPhone(){

 

 

return this.cellPhone

;

}

 

 

 

public void

setBirthday(Date bir){

 

 

this.birthday

=bir;

}

 

 

public

Date getBirthday(){

 

 

return this.birthday

;

}

 

 

public void

setEmail(String em){

 

 

this.email

=em;

}

 

 

public

String getEmail(){

 

 

return this.email

;

}

 

 

public

String getGender(){

 

 

return this.gender

;

}

 

 

public void

setGender(String gender){

 

 

this.gender

=gender;

}

 

 

 

public void

setAge(String age){

 

 

this.age

=age;

}

 

 

public

String getAge(){

 

 

return this.age

;

}

 

 

 

public

String getNickName(){

 

 

return this.nickName

;

}

 

 

public void

setNickName(String nn){

 

 

this.nickName

=nn;

}

 

 

public void

setName(String name){

 

 

this.name

=name;

}

 

 

public

String getName(){

 

 

return this.name

;

}

 

 

public

Long getId(){

 

 

return this.id

;

}

 

 

public void

setId(Long id){

 

 

this.id

=id;}

}

 

 

Post.java

package

 

 

com.hzau.information.domain;

 

import

 

 

java.util.Date;

import

 

 

java.util.HashSet;

import

 

 

java.util.Set;

 

public

 

 

class Post {

 

private Long id;

 

private String title;

 

private String content;

 

private Long poster;

 

private int readCount;

 

private int commentCount;

 

private Date postTime;

 

private Set<Comment> comments=new HashSet<Comment>();

 

 

public void setComments(Set<Comment> comments){

 

this.comments=comments;

}

 

public Set<Comment> getComments(){

 

return this.comments;

}

 

 

public void setPostTime(Date postTime){

 

this.postTime=postTime;

}

 

public Date getPostTime(){

 

return this.postTime;

}

 

public void setCommentCount(int comm){

 

this.commentCount=comm;

}

 

public int getCommentCount(){

 

return this.commentCount;

}

 

public void setReadCount(int c){

 

this.readCount=c;

}

 

 

public int getReadCount(){

 

return this.readCount;

}

 

public void setPoster(Long posterId){

 

this.poster=posterId;

}

 

public Long getPoster(){

 

return this.poster;

}

 

 

public void setContent(String content){

 

this.content=content;

}

 

public String getContent(){

 

return this.content;

}

 

public void setTitle(String title){

 

this.title=title;

}

 

public String getTitle(){

 

return this.title;

}

 

public void setId(Long id){

 

this.id=id;

}

 

 

public Long getId(){

 

return this.id;

}

}

 

 

 

 

SystemProfile.java

 

 

 

 

 

 

 

 

 

 

 

package

 

 

com.hzau.information.domain;

 

import

 

 

java.util.Date;

 

public

 

 

class

SystemProfile {

 

 

private Long id

;

 

 

private int level

;

 

 

private Date registerDate

;

 

 

private Long onLineTime

;

 

 

private int contribute

;

 

 

 

public void setContribute(int

con){

 

 

this.contribute

=con;

}

 

 

 

public int

getContribute(){

 

 

return this.contribute

;

}

 

 

public void

setOnLineTime(Long online){

 

 

this.onLineTime

=online;

}

 

 

 

public

Long getOnLineTime(){

 

 

return this.onLineTime

;

}

 

 

 

public

Date getRegisterDate(){

 

 

return this.registerDate

;

}

 

 

 

public void

setRegisterDate(Date regist){

 

 

this.registerDate

=regist;

}

 

 

public

Long getId(){

 

 

return this.id

;

}

 

 

 

public void

setId(Long id){

 

 

this.id

=id;

}

 

 

 

public int

getLevel(){

 

 

return this.level

;

}

 

 

public void setLevel(int

level){

 

 

this.level

=level;

}}

 

 

 

test.java

package

 

 

com.hzau.information.domain;

 

import

 

 

java.util.ArrayList;

import

 

 

java.util.Date;

import

 

 

java.util.List;

 

import

 

 

org.hibernate.Session;

import

 

 

org.hibernate.SessionFactory;

import

 

 

org.hibernate.Transaction;

 

import

 

 

com.hzau.information.HibernateUtil;

 

public

 

 

class test {

 

public static void main(String args[]){

SessionFactory sessionFactory=HibernateUtil.getSessionFactory();

Session session=sessionFactory.openSession();

Transaction transaction=session.beginTransaction();

 

 

Topic topic=

new Topic();

topic.setIntro(

"This is the first topic!");

topic.setSetupDate(

new Date());

List<Post> posts=

new ArrayList<Post>();

 

Post post=

new Post();

post.setPostTime(

new Date());

posts.add(post);

session.save(post);

 

topic.setPosts(posts);

session.save(topic);

 

 

 

 

transaction.commit();

session.close();

 

 

}

}

 

 

topic.java

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

package

 

 

com.hzau.information.domain;

 

import

 

 

java.util.Date;

import

 

 

java.util.List;

 

public

 

 

class

Topic {

 

 

private Long id

;

 

 

private List<Post> posts

;

 

 

private Date setupDate

;

 

 

private User moderator

;

 

 

private int postCount

;

 

 

private String intro

;

 

 

 

public void

setIntro(String intro){

 

 

this.intro

=intro;

}

 

 

public

String getIntro(){

 

 

return this.intro

;

}

 

 

public void setPostCount(int

pc){

 

 

this.postCount

=pc;

}

 

 

public int

getPostCount(){

 

 

return this.postCount

;

}

 

 

public void

setModerator(User mod){

 

 

this.moderator

=mod;

}

 

 

public

User getModerator(){

 

 

return this.moderator

;

}

 

 

public

Date getSetupDate(){

 

 

return this.setupDate

;

}

 

 

public void

setSetupDate(Date set){

 

 

this.setupDate

=set;

}

 

 

public void

setPosts(List<Post> posts){

 

 

this.posts

=posts;

}

 

 

public

List<Post> getPosts(){

 

 

return this.posts

;

}

 

 

public

Long getId(){

 

 

return this.id

;

}

 

 

public void

setId(Long id){

 

 

this.id

=id;}}

 

 

 

User.java

package

 

 

com.hzau.information.domain;

 

import

 

 

java.util.ArrayList;

 

public

 

 

class User {

 

private Long id;

 

private String userName;

 

private String password;

 

private SystemProfile sysProfile;

 

private PersonalProfile perProfile;

 

private ArrayList<Post> posts;

 

 

public User(){}

 

 

public Long getId(){

 

return this.id;

}

 

public void setId(Long id){

 

this.id=id;

}

 

 

public String getUserName(){

 

return this.userName;

}

 

 

public void setuserName(String userName){

 

this.userName=userName;

}

 

 

public String getPassword(){

 

return this.password;

}

 

 

public void setPassword(String password){

 

this.password=password;

}

 

 

public void setSysProfile(SystemProfile sysProfile){

 

this.sysProfile=sysProfile;

}

 

 

public SystemProfile getSysProfile(){

 

return this.sysProfile;

}

 

 

public void setPerProfile(PersonalProfile perProfile){

 

this.perProfile=perProfile;

}

 

 

public PersonalProfile getPerProfile(){

 

return this.perProfile;

}

 

 

public ArrayList<Post> getPosts(){

 

return this.posts;

}

 

 

public void setPosts(ArrayList<Post> posts){

 

this.posts=posts;

}

 

 

}

原创粉丝点击