Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Accounting and Billing Portal
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[abportal] View of /src/main/java/eu/smartlm/abs/portal/security/login/model/User.java
[abportal] / src / main / java / eu / smartlm / abs / portal / security / login / model / User.java Repository:
ViewVC logotype

View of /src/main/java/eu/smartlm/abs/portal/security/login/model/User.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (download) (annotate)
Wed Jul 28 10:05:51 2010 UTC (13 years, 9 months ago) by dgarcia
File size: 2737 byte(s)
First code commit
package eu.smartlm.abs.portal.security.login.model;

import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * POJO object that contains all the User information for the Accounting and Billing Portlets
 * @author David García Pérez - CESGA
 */
@Entity
@Table(name="USER_TBL")
public class User {
	@Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="id")
	private int id;
		
	@NotEmpty
	@Column(name="username", unique=true)
	private String username;
	
	@NotEmpty
    @Column(name="password")	
	private String password;

	@NotEmpty
	@Column(name="accounting_username")
	private String accountingUsername;

	@Column(name="accounting_group")
	private String accountingGroup;

	@Column(name="see_accounting_group_data")
	private boolean seeAccountingGroupData;

	@Column(name="see_all")
	private boolean seeAll;
	
	public User(String username, String password, String accountingUsername, String accountingGroup, boolean seeAccountingGroupData, boolean seeAll) {
		this.username = username;
		this.password = password;
		this.accountingUsername = accountingUsername;
		this.accountingGroup = accountingGroup;
		this.seeAccountingGroupData = seeAccountingGroupData;
		this.seeAll = seeAll;
	}
	
	public User() {}

	public int getId() {
                return id;
        }

        public void setId(int id) {
                this.id = id;
        }
	
	public void setUsername(String username) {
		this.username = username;
	}
	public String getUsername() {
		return username;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getPassword() {
		return password;
	}

	public void setAccountingUsername(String accountingUsername) {
		this.accountingUsername = accountingUsername;
	}

	public String getAccountingUsername() {
		return accountingUsername;
	}

	public void setAccountingGroup(String accountingGroup) {
		this.accountingGroup = accountingGroup;
	}

	public String getAccountingGroup() {
		return accountingGroup;
	}

	public void setSeeAccountingGroupData(boolean seeAccountingGroupData) {
		this.seeAccountingGroupData = seeAccountingGroupData;
	}

	public boolean isSeeAccountingGroupData() {
		return seeAccountingGroupData;
	}

	public void setSeeAll(boolean seeAll) {
		this.seeAll = seeAll;
	}

	public boolean isSeeAll() {
		return seeAll;
	}

	@Override
	public boolean equals(Object otherObject) {
		User otherUser = (User) otherObject;

		if(otherUser.getUsername().equals(this.username)) {
			return true;
		} else {
			return false;
		}
	}
}

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge