Subversion Repositories WebE

Rev

Rev 18 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

1
package ch.ffhs.webE.domain;

// Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1

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 = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "username"))
public class User implements java.io.Serializable {

        private Integer id;
        private String username;
        private String password;
        private String firstname;
        private String lastname;
        private boolean admin;
        private Set<Object> objectsForOwnerId = new HashSet<Object>(0);
        private Set<Object> objectsForEditorId = new HashSet<Object>(0);
        private Set<History> histories = new HashSet<History>(0);

        public User() {
        }

        public User(String username, String password, boolean admin) {
                this.username = username;
                this.password = password;
                this.admin = admin;
        }

        public User(String username, String password, String firstname,
                        String lastname, boolean admin, Set<Object> objectsForOwnerId,
                        Set<Object> objectsForEditorId, Set<History> histories) {
                this.username = username;
                this.password = password;
                this.firstname = firstname;
                this.lastname = lastname;
                this.admin = admin;
                this.objectsForOwnerId = objectsForOwnerId;
                this.objectsForEditorId = objectsForEditorId;
                this.histories = histories;
        }

        @Id
        @GeneratedValue(strategy = IDENTITY)
        @Column(name = "id", unique = true, nullable = false)
        public Integer getId() {
                return this.id;
        }

        public void setId(Integer id) {
                this.id = id;
        }

        @Column(name = "username", unique = true, nullable = false)
        public String getUsername() {
                return this.username;
        }

        public void setUsername(String username) {
                this.username = username;
        }

        @Column(name = "password", nullable = false, length = 32)
        public String getPassword() {
                return this.password;
        }

        public void setPassword(String password) {
                this.password = password;
        }

        @Column(name = "firstname", length = 45)
        public String getFirstname() {
                return this.firstname;
        }

        public void setFirstname(String firstname) {
                this.firstname = firstname;
        }

        @Column(name = "lastname", length = 45)
        public String getLastname() {
                return this.lastname;
        }

        public void setLastname(String lastname) {
                this.lastname = lastname;
        }

        @Column(name = "admin", nullable = false)
        public boolean isAdmin() {
                return this.admin;
        }

        public void setAdmin(boolean admin) {
                this.admin = admin;
        }

        @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByOwnerId")
        public Set<Object> getObjectsForOwnerId() {
                return this.objectsForOwnerId;
        }

        public void setObjectsForOwnerId(Set<Object> objectsForOwnerId) {
                this.objectsForOwnerId = objectsForOwnerId;
        }

        @OneToMany(fetch = FetchType.LAZY, mappedBy = "userByEditorId")
        public Set<Object> getObjectsForEditorId() {
                return this.objectsForEditorId;
        }

        public void setObjectsForEditorId(Set<Object> objectsForEditorId) {
                this.objectsForEditorId = objectsForEditorId;
        }

        @OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
        public Set<History> getHistories() {
                return this.histories;
        }

        public void setHistories(Set<History> histories) {
                this.histories = histories;
        }

}