Rev 21 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 18 | moos | 1 | package ch.ffhs.webE.domain; |
| 2 | |||
| 21 | moos | 3 | // Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1 |
| 4 | |||
| 33 | PointedEar | 5 | import static javax.persistence.GenerationType.IDENTITY; |
| 6 | |||
| 21 | moos | 7 | import java.util.HashSet; |
| 8 | import java.util.Set; |
||
| 33 | PointedEar | 9 | |
| 18 | moos | 10 | import javax.persistence.Column; |
| 11 | import javax.persistence.Entity; |
||
| 21 | moos | 12 | import javax.persistence.FetchType; |
| 18 | moos | 13 | import javax.persistence.GeneratedValue; |
| 14 | import javax.persistence.Id; |
||
| 21 | moos | 15 | import javax.persistence.OneToMany; |
| 18 | moos | 16 | import javax.persistence.Table; |
| 21 | moos | 17 | import javax.persistence.UniqueConstraint; |
| 18 | moos | 18 | |
| 21 | moos | 19 | /** |
| 20 | * User generated by hbm2java |
||
| 21 | */ |
||
| 18 | moos | 22 | @Entity |
| 21 | moos | 23 | @Table(name = "user", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "username")) |
| 33 | PointedEar | 24 | public class User implements java.io.Serializable |
| 25 | { |
||
| 26 | /** |
||
| 27 | * Version ID for serialization |
||
| 28 | */ |
||
| 29 | private static final long serialVersionUID = 1L; |
||
| 18 | moos | 30 | |
| 33 | PointedEar | 31 | private Integer id; |
| 32 | private String username; |
||
| 33 | private String password; |
||
| 34 | private String firstname; |
||
| 35 | private String lastname; |
||
| 36 | private boolean admin; |
||
| 37 | private Set<ObjectEntity> objectsForOwnerId = new HashSet<ObjectEntity>(0); |
||
| 38 | private Set<ObjectEntity> objectsForEditorId = new HashSet<ObjectEntity>(0); |
||
| 39 | private Set<History> histories = new HashSet<History>(0); |
||
| 21 | moos | 40 | |
| 33 | PointedEar | 41 | public User() |
| 42 | { |
||
| 43 | } |
||
| 21 | moos | 44 | |
| 33 | PointedEar | 45 | public User(String username, String password, boolean admin) |
| 46 | { |
||
| 47 | this.username = username; |
||
| 48 | this.password = password; |
||
| 49 | this.admin = admin; |
||
| 50 | } |
||
| 21 | moos | 51 | |
| 33 | PointedEar | 52 | public User(String username, String password, String firstname, |
| 53 | String lastname, boolean admin, Set<ObjectEntity> objectsForOwnerId, |
||
| 54 | Set<ObjectEntity> objectsForEditorId, Set<History> histories) |
||
| 55 | { |
||
| 56 | this.username = username; |
||
| 57 | this.password = password; |
||
| 58 | this.firstname = firstname; |
||
| 59 | this.lastname = lastname; |
||
| 60 | this.admin = admin; |
||
| 61 | this.objectsForOwnerId = objectsForOwnerId; |
||
| 62 | this.objectsForEditorId = objectsForEditorId; |
||
| 63 | this.histories = histories; |
||
| 64 | } |
||
| 21 | moos | 65 | |
| 33 | PointedEar | 66 | @Id |
| 67 | @GeneratedValue(strategy = IDENTITY) |
||
| 68 | @Column(name = "id", unique = true, nullable = false) |
||
| 69 | public Integer getId() |
||
| 70 | { |
||
| 71 | return this.id; |
||
| 72 | } |
||
| 21 | moos | 73 | |
| 33 | PointedEar | 74 | public void setId(Integer id) |
| 75 | { |
||
| 76 | this.id = id; |
||
| 77 | } |
||
| 21 | moos | 78 | |
| 33 | PointedEar | 79 | @Column(name = "username", unique = true, nullable = false) |
| 80 | public String getUsername() |
||
| 81 | { |
||
| 82 | return this.username; |
||
| 83 | } |
||
| 21 | moos | 84 | |
| 33 | PointedEar | 85 | public void setUsername(String username) |
| 86 | { |
||
| 87 | this.username = username; |
||
| 88 | } |
||
| 21 | moos | 89 | |
| 33 | PointedEar | 90 | @Column(name = "password", nullable = false, length = 32) |
| 91 | public String getPassword() |
||
| 92 | { |
||
| 93 | return this.password; |
||
| 94 | } |
||
| 21 | moos | 95 | |
| 33 | PointedEar | 96 | public void setPassword(String password) |
| 97 | { |
||
| 98 | this.password = password; |
||
| 99 | } |
||
| 21 | moos | 100 | |
| 33 | PointedEar | 101 | @Column(name = "firstname", length = 45) |
| 102 | public String getFirstname() |
||
| 103 | { |
||
| 104 | return this.firstname; |
||
| 105 | } |
||
| 21 | moos | 106 | |
| 33 | PointedEar | 107 | public void setFirstname(String firstname) |
| 108 | { |
||
| 109 | this.firstname = firstname; |
||
| 110 | } |
||
| 21 | moos | 111 | |
| 33 | PointedEar | 112 | @Column(name = "lastname", length = 45) |
| 113 | public String getLastname() |
||
| 114 | { |
||
| 115 | return this.lastname; |
||
| 116 | } |
||
| 21 | moos | 117 | |
| 33 | PointedEar | 118 | public void setLastname(String lastname) |
| 119 | { |
||
| 120 | this.lastname = lastname; |
||
| 121 | } |
||
| 21 | moos | 122 | |
| 33 | PointedEar | 123 | @Column(name = "admin", nullable = false) |
| 124 | public boolean isAdmin() |
||
| 125 | { |
||
| 126 | return this.admin; |
||
| 127 | } |
||
| 21 | moos | 128 | |
| 33 | PointedEar | 129 | public void setAdmin(boolean admin) |
| 130 | { |
||
| 131 | this.admin = admin; |
||
| 132 | } |
||
| 21 | moos | 133 | |
| 33 | PointedEar | 134 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByOwnerId") |
| 135 | public Set<ObjectEntity> getObjectsForOwnerId() |
||
| 136 | { |
||
| 137 | return this.objectsForOwnerId; |
||
| 138 | } |
||
| 21 | moos | 139 | |
| 33 | PointedEar | 140 | public void setObjectsForOwnerId(Set<ObjectEntity> objectsForOwnerId) |
| 141 | { |
||
| 142 | this.objectsForOwnerId = objectsForOwnerId; |
||
| 143 | } |
||
| 21 | moos | 144 | |
| 33 | PointedEar | 145 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByEditorId") |
| 146 | public Set<ObjectEntity> getObjectsForEditorId() |
||
| 147 | { |
||
| 148 | return this.objectsForEditorId; |
||
| 149 | } |
||
| 21 | moos | 150 | |
| 33 | PointedEar | 151 | public void setObjectsForEditorId(Set<ObjectEntity> objectsForEditorId) |
| 152 | { |
||
| 153 | this.objectsForEditorId = objectsForEditorId; |
||
| 154 | } |
||
| 21 | moos | 155 | |
| 33 | PointedEar | 156 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "user") |
| 157 | public Set<History> getHistories() |
||
| 158 | { |
||
| 159 | return this.histories; |
||
| 160 | } |
||
| 21 | moos | 161 | |
| 33 | PointedEar | 162 | public void setHistories(Set<History> histories) |
| 163 | { |
||
| 164 | this.histories = histories; |
||
| 165 | } |
||
| 21 | moos | 166 | |
| 18 | moos | 167 | } |