forked from Coded/SIPRP
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
467 lines
11 KiB
467 lines
11 KiB
/*
|
|
* Utilizador.java
|
|
*
|
|
* Created on September 20, 2007, 9:58 AM
|
|
*
|
|
* To change this template, choose Tools | Template Manager
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
package beans;
|
|
|
|
import db.data.siprp.outer.UtilizadoresData;
|
|
import org.apache.commons.lang.builder.ToStringBuilder;
|
|
|
|
import java.io.Serializable;
|
|
import java.sql.Date;
|
|
|
|
/**
|
|
*
|
|
* @author lluis
|
|
*/
|
|
public class Utilizador implements Serializable
|
|
{
|
|
private Integer id;
|
|
private String login;
|
|
private String password;
|
|
private String email;
|
|
private Integer empresa_id;
|
|
private Integer estabelecimento_id;
|
|
private String administrador;
|
|
private Integer tipo;
|
|
private String numero_cedula;
|
|
private String cap;
|
|
|
|
private Integer codigo_permissao;
|
|
|
|
private String nome;
|
|
|
|
private Integer medico_id;
|
|
private Integer funcionario_hst_id;
|
|
|
|
private String activo;
|
|
|
|
private Integer acesso;
|
|
private String responsavel_loja;
|
|
private String gestor_geral;
|
|
|
|
private String numero_mecanografico;
|
|
private String categoria; //descricao do 'tipo''
|
|
private String nome_estabelecimento;
|
|
|
|
private String primeiro_login;
|
|
|
|
private String apagado;
|
|
|
|
private Date data_password;
|
|
|
|
private Integer estabelecimento_gestor = null;
|
|
|
|
/** Creates a new instance of Utilizador */
|
|
public Utilizador() {
|
|
}
|
|
|
|
public Utilizador( UtilizadoresData utilizadoresData )
|
|
{
|
|
this.withId( utilizadoresData.getId() );
|
|
this.withLogin( utilizadoresData.getLogin() );
|
|
this.withPassword( utilizadoresData.getPassword() );
|
|
this.withData_password( new Date( utilizadoresData.getData_password().getTime() ) );
|
|
this.withEmail( utilizadoresData.getEmail() );
|
|
this.withEmpresa_id( utilizadoresData.getEmpresa_id() );
|
|
this.withEstabelecimento_id( utilizadoresData.getEstabelecimento_id() );
|
|
this.withAdministrador( utilizadoresData.getAdministrador() );
|
|
this.withTipo( utilizadoresData.getTipo() );
|
|
this.withNumero_cedula( utilizadoresData.getNumero_cedula() );
|
|
this.withCap( utilizadoresData.getCap() );
|
|
this.withNome( utilizadoresData.getNome() );
|
|
this.withMedico_id( utilizadoresData.getMedico_id() );
|
|
this.withFuncionario_hst_id( utilizadoresData.getFuncionario_hst_id() );
|
|
this.withActivo( utilizadoresData.getActivo() );
|
|
this.withResponsavel_loja( utilizadoresData.getResponsavel_loja() );
|
|
this.withGestor_geral( utilizadoresData.getGestor_geral() );
|
|
this.withPrimeiro_login( utilizadoresData.getPrimeiro_login() );
|
|
this.withApagado( utilizadoresData.getApagado() );
|
|
}
|
|
|
|
public Utilizador withId( final Integer id )
|
|
{
|
|
this.id = id;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withLogin( final String login )
|
|
{
|
|
this.login = login;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withPassword( final String password )
|
|
{
|
|
this.password = password;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withEmail( final String email )
|
|
{
|
|
this.email = email;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withEmpresa_id( final Integer empresa_id )
|
|
{
|
|
this.empresa_id = empresa_id;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withEstabelecimento_id( final Integer estabelecimento_id )
|
|
{
|
|
this.estabelecimento_id = estabelecimento_id;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withAdministrador( final String administrador )
|
|
{
|
|
this.administrador = administrador;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withTipo( final Integer tipo )
|
|
{
|
|
this.tipo = tipo;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withNumero_cedula( final String numero_cedula )
|
|
{
|
|
this.numero_cedula = numero_cedula;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withCap( final String cap )
|
|
{
|
|
this.cap = cap;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withCodigo_permissao( final Integer codigo_permissao )
|
|
{
|
|
this.codigo_permissao = codigo_permissao;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withNome( final String nome )
|
|
{
|
|
this.nome = nome;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withMedico_id( final Integer medico_id )
|
|
{
|
|
this.medico_id = medico_id;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withFuncionario_hst_id( final Integer funcionario_hst_id )
|
|
{
|
|
this.funcionario_hst_id = funcionario_hst_id;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withActivo( final String activo )
|
|
{
|
|
this.activo = activo;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withAcesso( final Integer acesso )
|
|
{
|
|
this.acesso = acesso;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withResponsavel_loja( final String responsavel_loja )
|
|
{
|
|
this.responsavel_loja = responsavel_loja;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withGestor_geral( final String gestor_geral )
|
|
{
|
|
this.gestor_geral = gestor_geral;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withNumero_mecanografico( final String numero_mecanografico )
|
|
{
|
|
this.numero_mecanografico = numero_mecanografico;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withCategoria( final String categoria )
|
|
{
|
|
this.categoria = categoria;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withNome_estabelecimento( final String nome_estabelecimento )
|
|
{
|
|
this.nome_estabelecimento = nome_estabelecimento;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withPrimeiro_login( final String primeiro_login )
|
|
{
|
|
this.primeiro_login = primeiro_login;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withApagado( final String apagado )
|
|
{
|
|
this.apagado = apagado;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withData_password( final Date data_password )
|
|
{
|
|
this.data_password = data_password;
|
|
return this;
|
|
}
|
|
|
|
public Utilizador withEstabelecimento_gestor( final Integer estabelecimento_gestor )
|
|
{
|
|
this.estabelecimento_gestor = estabelecimento_gestor;
|
|
return this;
|
|
}
|
|
|
|
|
|
public Integer getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(Integer id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getLogin() {
|
|
return login;
|
|
}
|
|
|
|
public void setLogin(String login) {
|
|
this.login = login;
|
|
}
|
|
|
|
public String getPassword() {
|
|
return password;
|
|
}
|
|
|
|
public void setPassword(String password) {
|
|
this.password = password;
|
|
}
|
|
|
|
public String getEmail() {
|
|
return email;
|
|
}
|
|
|
|
public void setEmail(String email) {
|
|
this.email = email;
|
|
}
|
|
|
|
public Integer getEmpresa_id() {
|
|
return empresa_id;
|
|
}
|
|
|
|
public void setEmpresa_id(Integer empresa_id) {
|
|
this.empresa_id = empresa_id;
|
|
}
|
|
|
|
public Integer getEstabelecimento_id() {
|
|
return estabelecimento_id;
|
|
}
|
|
|
|
public void setEstabelecimento_id(Integer estabelecimento_id) {
|
|
this.estabelecimento_id = estabelecimento_id;
|
|
}
|
|
|
|
public String getAdministrador() {
|
|
return administrador;
|
|
}
|
|
|
|
public void setAdministrador(String administrador) {
|
|
this.administrador = administrador;
|
|
}
|
|
|
|
public Integer getCodigo_permissao() {
|
|
return codigo_permissao;
|
|
}
|
|
|
|
public void setCodigo_permissao(Integer codigo_permissao) {
|
|
this.codigo_permissao = codigo_permissao;
|
|
}
|
|
|
|
public Integer getTipo() {
|
|
return tipo;
|
|
}
|
|
|
|
public void setTipo(Integer tipo) {
|
|
this.tipo = tipo;
|
|
}
|
|
|
|
public String getNumero_cedula() {
|
|
return numero_cedula;
|
|
}
|
|
|
|
public void setNumero_cedula(String numero_cedula) {
|
|
this.numero_cedula = numero_cedula;
|
|
}
|
|
|
|
public String getCap() {
|
|
return cap;
|
|
}
|
|
|
|
public void setCap(String cap) {
|
|
this.cap = cap;
|
|
}
|
|
|
|
public String getNome() {
|
|
return nome;
|
|
}
|
|
|
|
public void setNome(String nome) {
|
|
this.nome = nome;
|
|
}
|
|
|
|
public Integer getMedico_id() {
|
|
return medico_id;
|
|
}
|
|
|
|
public void setMedico_id(Integer medico_id) {
|
|
this.medico_id = medico_id;
|
|
}
|
|
|
|
public Integer getFuncionario_hst_id() {
|
|
return funcionario_hst_id;
|
|
}
|
|
|
|
public void setFuncionario_hst_id(Integer funcionario_hst_id) {
|
|
this.funcionario_hst_id = funcionario_hst_id;
|
|
}
|
|
|
|
public String getActivo() {
|
|
return activo;
|
|
}
|
|
|
|
public void setActivo(String activo) {
|
|
this.activo = activo;
|
|
}
|
|
|
|
public Integer getAcesso() {
|
|
return acesso;
|
|
}
|
|
|
|
public void setAcesso(Integer acesso) {
|
|
this.acesso = acesso;
|
|
}
|
|
|
|
public String getResponsavel_loja() {
|
|
return responsavel_loja;
|
|
}
|
|
|
|
public void setResponsavel_loja(String responsavel_loja) {
|
|
this.responsavel_loja = responsavel_loja;
|
|
}
|
|
|
|
public String getNumero_mecanografico()
|
|
{
|
|
String n = numero_mecanografico;
|
|
if ( n != null && "null".equals( n ) )
|
|
{
|
|
n = "";
|
|
}
|
|
return n;
|
|
}
|
|
|
|
public void setNumero_mecanografico(String numero_mecanografico)
|
|
{
|
|
this.numero_mecanografico = numero_mecanografico;
|
|
}
|
|
|
|
public String getCategoria() {
|
|
return categoria;
|
|
}
|
|
|
|
public void setCategoria(String categoria) {
|
|
this.categoria = categoria;
|
|
}
|
|
|
|
public String getNome_estabelecimento() {
|
|
return nome_estabelecimento;
|
|
}
|
|
|
|
public void setNome_estabelecimento(String nome_estabelecimento) {
|
|
this.nome_estabelecimento = nome_estabelecimento;
|
|
}
|
|
|
|
public String getGestor_geral() {
|
|
return gestor_geral;
|
|
}
|
|
|
|
public void setGestor_geral(String gestor_geral) {
|
|
this.gestor_geral = gestor_geral;
|
|
}
|
|
|
|
public String getPrimeiro_login() {
|
|
return primeiro_login;
|
|
}
|
|
|
|
public void setPrimeiro_login(String primeiro_login) {
|
|
this.primeiro_login = primeiro_login;
|
|
}
|
|
|
|
public String getApagado() {
|
|
return apagado;
|
|
}
|
|
|
|
public void setApagado(String apagado) {
|
|
this.apagado = apagado;
|
|
}
|
|
|
|
public Date getData_password() {
|
|
return data_password;
|
|
}
|
|
|
|
public void setData_password(Date data_password) {
|
|
this.data_password = data_password;
|
|
}
|
|
|
|
/**
|
|
* @return the estabelecimento_gestor
|
|
*/
|
|
public Integer getEstabelecimento_gestor() {
|
|
return estabelecimento_gestor;
|
|
}
|
|
|
|
/**
|
|
* @param estabelecimento_gestor the estabelecimento_gestor to set
|
|
*/
|
|
public void setEstabelecimento_gestor(Integer estabelecimento_gestor) {
|
|
this.estabelecimento_gestor = estabelecimento_gestor;
|
|
}
|
|
|
|
public static Utilizador createUtilizador( )
|
|
{
|
|
return new Utilizador( );
|
|
}
|
|
|
|
public static Utilizador createUtilizador( UtilizadoresData utilizadoresData )
|
|
{
|
|
return new Utilizador( utilizadoresData );
|
|
}
|
|
|
|
@Override
|
|
public String toString()
|
|
{
|
|
return new ToStringBuilder( this ).append( "id", id ).append( "login", login ).append( "password", password ).append( "email", email ).append( "empresa_id", empresa_id ).append( "estabelecimento_id", estabelecimento_id ).append( "administrador", administrador ).append( "tipo", tipo ).append( "numero_cedula", numero_cedula ).append( "cap", cap ).append( "codigo_permissao", codigo_permissao ).append( "nome", nome ).append( "medico_id", medico_id ).append( "funcionario_hst_id", funcionario_hst_id ).append( "activo", activo ).append( "acesso", acesso ).append( "responsavel_loja", responsavel_loja ).append( "gestor_geral", gestor_geral ).append( "numero_mecanografico", numero_mecanografico ).append( "categoria", categoria ).append( "nome_estabelecimento", nome_estabelecimento ).append( "primeiro_login", primeiro_login ).append( "apagado", apagado ).append( "data_password", data_password ).append( "estabelecimento_gestor", estabelecimento_gestor ).toString();
|
|
}
|
|
}
|