aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java')
-rw-r--r--id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java263
1 files changed, 263 insertions, 0 deletions
diff --git a/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java
new file mode 100644
index 000000000..d1887bfa6
--- /dev/null
+++ b/id/server/moa-id-commons/src/main/java/at/gv/egovernment/moa/id/commons/db/dao/config/UserDatabase.java
@@ -0,0 +1,263 @@
+package at.gv.egovernment.moa.id.commons.db.dao.config;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.PreUpdate;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+
+import org.hibernate.annotations.DynamicUpdate;
+
+import at.gv.egovernment.moa.id.commons.db.dao.config.OnlineApplication;
+
+
+@Entity
+@DynamicUpdate(value=true)
+@Table(name = "userdatabase")
+public class UserDatabase implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "id", unique=true, nullable=false)
+ private long id;
+
+ @Column(name = "givenname", nullable=false)
+ private String givenname;
+
+ @Column(name = "familyname", nullable=false)
+ private String familyname;
+
+ @Column(name = "institut", nullable=false)
+ private String institut;
+
+ @Column(name = "mail", nullable=false)
+ private String mail;
+
+ @Column(name = "phone", nullable=false)
+ private String phone;
+
+ @Column(name = "username", unique=true, nullable=false)
+ private String username;
+
+ @Column(name = "password", nullable=false)
+ private String password;
+
+ @Column(name = "bpk", unique=true, nullable=false)
+ private String bpk;
+
+ @Column(name = "isadmin", nullable=false)
+ private boolean isadmin;
+
+ @Column(name = "isactive", nullable=false)
+ private boolean isactive;
+
+ @OneToMany(mappedBy="hjid", cascade=CascadeType.REFRESH)
+ private List<OnlineApplication> registratedOAs = null;
+
+ @Column(name = "lastlogin")
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date lastlogin;
+
+ @PreUpdate
+ protected void lastUpdate() {
+ this.lastlogin = new Date();
+ }
+
+ /**
+ * @return the id
+ */
+ public long getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the givenname
+ */
+ public String getGivenname() {
+ return givenname;
+ }
+
+ /**
+ * @param givenname the givenname to set
+ */
+ public void setGivenname(String givenname) {
+ this.givenname = givenname;
+ }
+
+ /**
+ * @return the familyname
+ */
+ public String getFamilyname() {
+ return familyname;
+ }
+
+ /**
+ * @param familyname the familyname to set
+ */
+ public void setFamilyname(String familyname) {
+ this.familyname = familyname;
+ }
+
+ /**
+ * @return the institut
+ */
+ public String getInstitut() {
+ return institut;
+ }
+
+ /**
+ * @param institut the institut to set
+ */
+ public void setInstitut(String institut) {
+ this.institut = institut;
+ }
+
+ /**
+ * @return the mail
+ */
+ public String getMail() {
+ return mail;
+ }
+
+ /**
+ * @param mail the mail to set
+ */
+ public void setMail(String mail) {
+ this.mail = mail;
+ }
+
+ /**
+ * @return the phone
+ */
+ public String getPhone() {
+ return phone;
+ }
+
+ /**
+ * @param phone the phone to set
+ */
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ /**
+ * @return the username
+ */
+ public String getUsername() {
+ return username;
+ }
+
+ /**
+ * @param username the username to set
+ */
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ /**
+ * @return the password
+ */
+ public String getPassword() {
+ return password;
+ }
+
+ /**
+ * @param password the password to set
+ */
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ /**
+ * @return the bpk
+ */
+ public String getBpk() {
+ return bpk;
+ }
+
+ /**
+ * @param bpk the bpk to set
+ */
+ public void setBpk(String bpk) {
+ this.bpk = bpk;
+ }
+
+ /**
+ * @return the isadmin
+ */
+ public boolean isIsadmin() {
+ return isadmin;
+ }
+
+ /**
+ * @param isadmin the isadmin to set
+ */
+ public void setIsadmin(boolean isadmin) {
+ this.isadmin = isadmin;
+ }
+
+ /**
+ * @return the isactive
+ */
+ public boolean isIsactive() {
+ return isactive;
+ }
+
+ /**
+ * @param isactive the isactive to set
+ */
+ public void setIsactive(boolean isactive) {
+ this.isactive = isactive;
+ }
+
+ /**
+ * @return the registratedOAs
+ */
+ public List<OnlineApplication> getRegistratedOAs() {
+ return registratedOAs;
+ }
+
+ /**
+ * @param registratedOAs the registratedOAs to set
+ */
+ public void setRegistratedOAs(List<OnlineApplication> registratedOAs) {
+ this.registratedOAs = registratedOAs;
+ }
+
+ /**
+ * @return the lastlogin
+ */
+ public Date getLastlogin() {
+ return lastlogin;
+ }
+
+ /**
+ * @param lastlogin the lastlogin to set
+ */
+ public void setLastlogin(Date lastlogin) {
+ this.lastlogin = lastlogin;
+ }
+
+
+}
+
+