package com.lst.lc.entities; // Generated 2015-8-25 19:01:07 by Hibernate Tools 4.3.1 import java.util.HashSet; import java.util.Set; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import static javax.persistence.GenerationType.IDENTITY; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.UniqueConstraint; /** * User generated by hbm2java */ @Entity @Table(name = "user", catalog = "LearningCommunity", uniqueConstraints = @UniqueConstraint(columnNames = "email")) public class User implements java.io.Serializable { private static final long serialVersionUID = 1L; private Integer userId; private String userName; private String email; private String password; private String gender; private int integral; private String rank; private String avatar; private String type; private String motto; private String city; private Set<BlogComment> blogComments = new HashSet<BlogComment>(0); private Set<RelUserRoute> relUserRoutes = new HashSet<RelUserRoute>(0); private Set<Letter> lettersForToUid = new HashSet<Letter>(0); private Set<QuestionAnswer> questionAnswers = new HashSet<QuestionAnswer>( 0); private Set<Question> questions = new HashSet<Question>(0); private Set<LessonComment> lessonComments = new HashSet<LessonComment>( 0); private Set<Blog> blogs = new HashSet<Blog>(0); private Set<RelUser> relUsersForUserId1 = new HashSet<RelUser>(0); private Set<RelUserCourse> relUserCourses = new HashSet<RelUserCourse>( 0); private Set<RelUser> relUsersForUserId2 = new HashSet<RelUser>(0); private Set<Letter> lettersForFromUid = new HashSet<Letter>(0); private Set<Feedback> feedbacks = new HashSet<Feedback>(0); public User() { } public User(String userName, String email, String password, String gender, int integral, String rank, String avatar, String type) { this.userName = userName; this.email = email; this.password = password; this.gender = gender; this.integral = integral; this.rank = rank; this.avatar = avatar; this.type = type; } public User(String userName, String email, String password, String gender, int integral, String rank, String avatar, String type, String motto, String city, Set<BlogComment> blogComments, Set<RelUserRoute> relUserRoutes, Set<Letter> lettersForToUid, Set<QuestionAnswer> questionAnswers, Set<Question> questions, Set<LessonComment> lessonComments, Set<Blog> blogs, Set<RelUser> relUsersForUserId1, Set<RelUserCourse> relUserCourses, Set<RelUser> relUsersForUserId2, Set<Letter> lettersForFromUid, Set<Feedback> feedbacks) { this.userName = userName; this.email = email; this.password = password; this.gender = gender; this.integral = integral; this.rank = rank; this.avatar = avatar; this.type = type; this.motto = motto; this.city = city; this.blogComments = blogComments; this.relUserRoutes = relUserRoutes; this.lettersForToUid = lettersForToUid; this.questionAnswers = questionAnswers; this.questions = questions; this.lessonComments = lessonComments; this.blogs = blogs; this.relUsersForUserId1 = relUsersForUserId1; this.relUserCourses = relUserCourses; this.relUsersForUserId2 = relUsersForUserId2; this.lettersForFromUid = lettersForFromUid; this.feedbacks = feedbacks; } @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "userId", unique = true, nullable = false) public Integer getUserId() { return this.userId; } public void setUserId(Integer userId) { this.userId = userId; } @Column(name = "userName", nullable = false, length = 50) public String getUserName() { return this.userName; } public void setUserName(String userName) { this.userName = userName; } @Column(name = "email", unique = true, nullable = false, length = 50) public String getEmail() { return this.email; } public void setEmail(String email) { this.email = email; } @Column(name = "password", nullable = false, length = 50) public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } @Column(name = "gender", nullable = false, length = 10) public String getGender() { return this.gender; } public void setGender(String gender) { this.gender = gender; } @Column(name = "integral", nullable = false) public int getIntegral() { return this.integral; } public void setIntegral(int integral) { this.integral = integral; } @Column(name = "rank", nullable = false, length = 10) public String getRank() { return this.rank; } public void setRank(String rank) { this.rank = rank; } @Column(name = "avatar", nullable = false, length = 100) public String getAvatar() { return this.avatar; } public void setAvatar(String avatar) { this.avatar = avatar; } @Column(name = "type", nullable = false, length = 10) public String getType() { return this.type; } public void setType(String type) { this.type = type; } @Column(name = "motto", length = 65535) public String getMotto() { return this.motto; } public void setMotto(String motto) { this.motto = motto; } @Column(name = "city", length = 50) public String getCity() { return this.city; } public void setCity(String city) { this.city = city; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") public Set<BlogComment> getBlogComments() { return this.blogComments; } public void setBlogComments(Set<BlogComment> blogComments) { this.blogComments = blogComments; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") public Set<RelUserRoute> getRelUserRoutes() { return this.relUserRoutes; } public void setRelUserRoutes(Set<RelUserRoute> relUserRoutes) { this.relUserRoutes = relUserRoutes; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByToUid") public Set<Letter> getLettersForToUid() { return this.lettersForToUid; } public void setLettersForToUid(Set<Letter> lettersForToUid) { this.lettersForToUid = lettersForToUid; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") public Set<QuestionAnswer> getQuestionAnswers() { return this.questionAnswers; } public void setQuestionAnswers(Set<QuestionAnswer> questionAnswers) { this.questionAnswers = questionAnswers; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") public Set<Question> getQuestions() { return this.questions; } public void setQuestions(Set<Question> questions) { this.questions = questions; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") public Set<LessonComment> getLessonComments() { return this.lessonComments; } public void setLessonComments(Set<LessonComment> lessonComments) { this.lessonComments = lessonComments; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") public Set<Blog> getBlogs() { return this.blogs; } public void setBlogs(Set<Blog> blogs) { this.blogs = blogs; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByUserId1") public Set<RelUser> getRelUsersForUserId1() { return this.relUsersForUserId1; } public void setRelUsersForUserId1(Set<RelUser> relUsersForUserId1) { this.relUsersForUserId1 = relUsersForUserId1; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") public Set<RelUserCourse> getRelUserCourses() { return this.relUserCourses; } public void setRelUserCourses(Set<RelUserCourse> relUserCourses) { this.relUserCourses = relUserCourses; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByUserId2") public Set<RelUser> getRelUsersForUserId2() { return this.relUsersForUserId2; } public void setRelUsersForUserId2(Set<RelUser> relUsersForUserId2) { this.relUsersForUserId2 = relUsersForUserId2; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByFromUid") public Set<Letter> getLettersForFromUid() { return this.lettersForFromUid; } public void setLettersForFromUid(Set<Letter> lettersForFromUid) { this.lettersForFromUid = lettersForFromUid; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") public Set<Feedback> getFeedbacks() { return this.feedbacks; } public void setFeedbacks(Set<Feedback> feedbacks) { this.feedbacks = feedbacks; } }