Rev 259 | Rev 302 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 259 | Rev 299 | ||
|---|---|---|---|
| Line 4... | Line 4... | ||
| 4 | import java.util.Date; |
4 | import java.util.Date; |
| - | 5 | import java.util.List; |
|
| 5 | 6 | ||
| - | 7 | import javax.persistence.CascadeType; |
|
| 6 | import javax.persistence.Column; |
8 | import javax.persistence.Column; |
| 7 | import javax.persistence.Entity; |
9 | import javax.persistence.Entity; |
| 8 | import javax.persistence.GeneratedValue; |
10 | import javax.persistence.GeneratedValue; |
| 9 | import javax.persistence.GenerationType; |
11 | import javax.persistence.GenerationType; |
| 10 | import javax.persistence.Id; |
12 | import javax.persistence.Id; |
| - | 13 | import javax.persistence.OneToMany; |
|
| 11 | import javax.persistence.SequenceGenerator; |
14 | import javax.persistence.SequenceGenerator; |
| 12 | import javax.persistence.Table; |
15 | import javax.persistence.Table; |
| 13 | import javax.persistence.Transient; |
16 | import javax.persistence.Transient; |
| - | 17 | import javax.validation.Valid; |
|
| 14 | import javax.validation.constraints.Size; |
18 | import javax.validation.constraints.Size; |
| 15 | 19 | ||
| 16 | import org.hibernate.validator.constraints.NotEmpty; |
20 | import org.hibernate.validator.constraints.NotEmpty; |
| 17 | 21 | ||
| 18 | import br.com.ec.core.interfaces.Alterar; |
22 | import br.com.ec.core.interfaces.Alterar; |
| 19 | import br.com.ec.core.interfaces.Cadastrar; |
23 | import br.com.ec.core.interfaces.Cadastrar; |
| 20 | import br.com.ec.core.util.StringUtil; |
24 | import br.com.ec.core.util.StringUtil; |
| 21 | import br.com.ec.core.util.VerificadorUtil; |
25 | import br.com.ec.core.util.VerificadorUtil; |
| - | 26 | import br.com.ec.domain.dto.PessoaDTO; |
|
| 22 | import br.com.ec.domain.model.tipos.TipoEscolaridade; |
27 | import br.com.ec.domain.model.tipos.TipoEscolaridade; |
| 23 | import br.com.ec.domain.model.tipos.TipoEstadoCivil; |
28 | import br.com.ec.domain.model.tipos.TipoEstadoCivil; |
| 24 | import br.com.ec.domain.model.tipos.TipoPessoa; |
29 | import br.com.ec.domain.model.tipos.TipoPessoa; |
| 25 | import br.com.ec.domain.model.tipos.TipoRacaCor; |
30 | import br.com.ec.domain.model.tipos.TipoRacaCor; |
| 26 | import br.com.ec.domain.model.tipos.TipoSexo; |
31 | import br.com.ec.domain.model.tipos.TipoSexo; |
| Line 38... | Line 43... | ||
| 38 | private String cpfCnpj; |
43 | private String cpfCnpj; |
| 39 | private String email; |
44 | private String email; |
| 40 | private String telefone; |
45 | private String telefone; |
| 41 | private String contato; |
46 | private String contato; |
| 42 | private String observacao; |
47 | private String observacao; |
| 43 | // private Set<PessoaPapel> papeis;
|
- | |
| 44 | 48 | ||
| 45 | // PESSOA FÍSICA
|
49 | // PESSOA FÍSICA
|
| 46 | private String sexo; |
50 | private String sexo; |
| 47 | private String rg; |
51 | private String rg; |
| 48 | private Date rgDataExpedicao; |
52 | private Date rgDataExpedicao; |
| 49 | private String rgOrgaoEmissor; |
53 | private String rgOrgaoEmissor; |
| 50 | private Date dataNascimento; |
54 | private Date dataNascimento; |
| 51 | private String nacionalidade; |
55 | private String nacionalidade; |
| 52 | private String localNascimento; |
56 | private String localNascimento; |
| 53 | private String UfNascimento; |
- | |
| - | 57 | private String ufNascimento; |
|
| 54 | private String nomePai; |
58 | private String nomePai; |
| 55 | private String nomeMae; |
59 | private String nomeMae; |
| 56 | private String tipoEstadoCivil; |
60 | private String tipoEstadoCivil; |
| 57 | private String tipoRacaCor; |
61 | private String tipoRacaCor; |
| 58 | private String tipoEscolaridade; |
62 | private String tipoEscolaridade; |
| - | 63 | ||
| - | 64 | private String pis; |
|
| - | 65 | private String ctps; |
|
| - | 66 | private String ctpsSerie; |
|
| - | 67 | private String ctpsUf; |
|
| - | 68 | private Boolean primeiroEmprego; |
|
| - | 69 | private Boolean optantePeloFGTS; |
|
| - | 70 | ||
| - | 71 | private Boolean pessoaDeficienteMotora; |
|
| - | 72 | private Boolean pessoaDeficienteVisual; |
|
| - | 73 | private Boolean pessoaDeficienteAuditiva; |
|
| - | 74 | private Boolean pessoaReabilitado; |
|
| - | 75 | private String pessoaDeficienteObservacao; |
|
| - | 76 | ||
| - | 77 | /*
|
|
| - | 78 | private String tituloEleitor;
|
|
| - | 79 | private String tituloEleitorZona;
|
|
| - | 80 | private String tituloEleitorSecao;
|
|
| - | 81 |
|
|
| - | 82 | private String carteiraReservista;
|
|
| - | 83 | private String carteiraReservistaCategoria;
|
|
| - | 84 |
|
|
| - | 85 | private String carteiraHabilitacao;
|
|
| - | 86 | private String carteiraHabilitacaoCategoria;
|
|
| - | 87 | private String carteiraHabilitacaoOrgaoEmissor;
|
|
| - | 88 | private String carteiraHabilitacaoUf;
|
|
| - | 89 | private Date carteiraHabilitacaoPrimeiraHabilitacao;
|
|
| - | 90 | */
|
|
| 59 | 91 | ||
| 60 | // PESSOA JURÍDICA
|
92 | // PESSOA JURÍDICA
|
| 61 | private String nomeFantasia; |
93 | private String nomeFantasia; |
| 62 | private String razaoSocial; |
94 | private String razaoSocial; |
| 63 | private String inscricaoEstadual; |
95 | private String inscricaoEstadual; |
| 64 | private Boolean inscricaoEstadualIsento; |
96 | private Boolean inscricaoEstadualIsento; |
| 65 | private String inscricaoMunicipal; |
97 | private String inscricaoMunicipal; |
| 66 | private String tipoRegimeTributario; |
98 | private String tipoRegimeTributario; |
| 67 | 99 | ||
| 68 | // CLIENTE
|
100 | // CLIENTE
|
| 69 | // private Modelo modeloCliente;
|
- | |
| 70 | private Boolean indicadorNovidades; |
101 | private Boolean indicadorNovidades; |
| 71 | 102 | ||
| 72 | // private Set<Endereco> enderecos;
|
- | |
| 73 | // private Set<DadosBancarios> dadosBancarios;
|
- | |
| 74 | - | ||
| - | 103 | private Boolean cadastroFinalizado; |
|
| 75 | private boolean ativo; |
104 | private boolean ativo; |
| - | 105 | ||
| - | 106 | private List<Endereco> enderecos; |
|
| 76 | 107 | ||
| 77 | public Pessoa() { |
108 | public Pessoa() { |
| 78 | // setTipoPessoa(TipoPessoa.FISICA_F.getValor());
|
109 | // setTipoPessoa(TipoPessoa.FISICA_F.getValor());
|
| 79 | // setInscricaoEstadualIsento(false);
|
110 | // setInscricaoEstadualIsento(false);
|
| 80 | /*
|
111 | /*
|
| 81 | setPapeis(new HashSet<PessoaPapel>());
|
112 | setPapeis(new HashSet<PessoaPapel>());
|
| 82 | setEnderecos(new HashSet<Endereco>());
|
113 | setEnderecos(new HashSet<Endereco>());
|
| 83 | setDadosBancarios(new HashSet<DadosBancarios>());
|
114 | setDadosBancarios(new HashSet<DadosBancarios>());
|
| 84 | */
|
115 | */
|
| 85 | }
|
116 | }
|
| - | 117 | ||
| - | 118 | public Pessoa(PessoaDTO pessoaDTO) { |
|
| - | 119 | this.sequencial = pessoaDTO.getSequencial(); |
|
| - | 120 | this.nome = pessoaDTO.getNome(); |
|
| - | 121 | this.tipoPessoa = pessoaDTO.getTipoPessoa(); |
|
| - | 122 | this.cpfCnpj = pessoaDTO.getCpfCnpj(); |
|
| - | 123 | this.email = pessoaDTO.getEmail(); |
|
| - | 124 | this.telefone = pessoaDTO.getTelefone(); |
|
| - | 125 | this.contato = pessoaDTO.getContato(); |
|
| - | 126 | this.observacao = pessoaDTO.getObservacao(); |
|
| - | 127 | ||
| - | 128 | // PESSOA FÍSICA
|
|
| - | 129 | this.sexo = pessoaDTO.getSexo(); |
|
| - | 130 | this.rg = pessoaDTO.getRg(); |
|
| - | 131 | this.rgDataExpedicao = pessoaDTO.getRgDataExpedicao(); |
|
| - | 132 | this.rgOrgaoEmissor = pessoaDTO.getRgOrgaoEmissor(); |
|
| - | 133 | this.dataNascimento = pessoaDTO.getDataNascimento(); |
|
| - | 134 | this.nacionalidade = pessoaDTO.getNacionalidade(); |
|
| - | 135 | this.localNascimento = pessoaDTO.getLocalNascimento(); |
|
| - | 136 | this.ufNascimento = pessoaDTO.getUfNascimento(); |
|
| - | 137 | this.nomePai = pessoaDTO.getNomePai(); |
|
| - | 138 | this.nomeMae = pessoaDTO.getNomeMae(); |
|
| - | 139 | this.tipoEstadoCivil = pessoaDTO.getTipoEstadoCivil(); |
|
| - | 140 | this.tipoRacaCor = pessoaDTO.getTipoRacaCor(); |
|
| - | 141 | this.tipoEscolaridade = pessoaDTO.getTipoEscolaridade(); |
|
| - | 142 | }
|
|
| - | 143 | ||
| - | 144 | // PESSOA JURÍDICA
|
|
| - | 145 | /*
|
|
| - | 146 | this.nomeFantasia = pessoaDTO.getN;
|
|
| - | 147 | this.razaoSocial = pessoaDTO.;
|
|
| - | 148 | this.inscricaoEstadual = pessoaDTO.;
|
|
| - | 149 | this.inscricaoEstadualIsento = pessoaDTO.;
|
|
| - | 150 | this.inscricaoMunicipal = pessoaDTO.;
|
|
| - | 151 | this.tipoRegimeTributario = pessoaDTO.;
|
|
| - | 152 | */
|
|
| 86 | 153 | ||
| 87 | @Id |
154 | @Id |
| 88 | @SequenceGenerator(name = "sq_pessoa") |
155 | @SequenceGenerator(name = "sq_pessoa") |
| 89 | @GeneratedValue(strategy=GenerationType.IDENTITY) |
156 | @GeneratedValue(strategy=GenerationType.IDENTITY) |
| 90 | @Column(name="seq_pessoa", nullable=false) |
157 | @Column(name="seq_pessoa", nullable=false) |
| Line 239... | Line 306... | ||
| 239 | }
|
306 | }
|
| 240 | 307 | ||
| 241 | @Column(name="dsc_nascimento_uf") |
308 | @Column(name="dsc_nascimento_uf") |
| 242 | @Size(max = 2, message = "Limite de caracteres ultrapassado: UF do Nascimento") |
309 | @Size(max = 2, message = "Limite de caracteres ultrapassado: UF do Nascimento") |
| 243 | public String getUfNascimento() { |
310 | public String getUfNascimento() { |
| 244 | return UfNascimento; |
- | |
| - | 311 | return ufNascimento; |
|
| 245 | }
|
312 | }
|
| 246 | public void setUfNascimento(String ufNascimento) { |
313 | public void setUfNascimento(String ufNascimento) { |
| 247 | UfNascimento = ufNascimento;
|
- | |
| - | 314 | this.ufNascimento = ufNascimento; |
|
| 248 | }
|
315 | }
|
| 249 | 316 | ||
| 250 | @Column(name="dsc_nome_pai") |
317 | @Column(name="dsc_nome_pai") |
| 251 | @Size(max = 120, message = "Limite de caracteres ultrapassado: Nome do Pai") |
318 | @Size(max = 120, message = "Limite de caracteres ultrapassado: Nome do Pai") |
| 252 | public String getNomePai() { |
319 | public String getNomePai() { |
| Line 299... | Line 366... | ||
| 299 | @Transient |
366 | @Transient |
| 300 | public String getDescricaoDaEscolaridade() { |
367 | public String getDescricaoDaEscolaridade() { |
| 301 | return VerificadorUtil.naoEstaNulo(getTipoEscolaridade())? TipoEscolaridade.parse(getTipoEscolaridade()).getDescricao() : null; |
368 | return VerificadorUtil.naoEstaNulo(getTipoEscolaridade())? TipoEscolaridade.parse(getTipoEscolaridade()).getDescricao() : null; |
| 302 | }
|
369 | }
|
| 303 | 370 | ||
| - | 371 | @Column(name="dsc_pis") |
|
| - | 372 | @Size(max = 20, message = "Limite de caracteres ultrapassado: PIS") |
|
| - | 373 | public String getPis() { |
|
| - | 374 | return pis; |
|
| - | 375 | }
|
|
| - | 376 | public void setPis(String pis) { |
|
| - | 377 | this.pis = pis; |
|
| - | 378 | }
|
|
| - | 379 | ||
| - | 380 | @Column(name="dsc_ctps") |
|
| - | 381 | @Size(max = 20, message = "Limite de caracteres ultrapassado: CTPS") |
|
| - | 382 | public String getCtps() { |
|
| - | 383 | return ctps; |
|
| - | 384 | }
|
|
| - | 385 | public void setCtps(String ctps) { |
|
| - | 386 | this.ctps = ctps; |
|
| - | 387 | }
|
|
| - | 388 | ||
| - | 389 | @Column(name="dsc_ctps_serie") |
|
| - | 390 | @Size(max = 6, message = "Limite de caracteres ultrapassado: SÉRIE DA CTPS") |
|
| - | 391 | public String getCtpsSerie() { |
|
| - | 392 | return ctpsSerie; |
|
| - | 393 | }
|
|
| - | 394 | public void setCtpsSerie(String ctpsSerie) { |
|
| - | 395 | this.ctpsSerie = ctpsSerie; |
|
| - | 396 | }
|
|
| - | 397 | ||
| - | 398 | @Column(name="dsc_ctps_uf") |
|
| - | 399 | @Size(max = 2, message = "Limite de caracteres ultrapassado: UF DA CTPS") |
|
| - | 400 | public String getCtpsUf() { |
|
| - | 401 | return ctpsUf; |
|
| - | 402 | }
|
|
| - | 403 | public void setCtpsUf(String ctpsUf) { |
|
| - | 404 | this.ctpsUf = ctpsUf; |
|
| - | 405 | }
|
|
| - | 406 | ||
| - | 407 | @Column(name="ind_primeiro_emprego") |
|
| - | 408 | public Boolean getPrimeiroEmprego() { |
|
| - | 409 | return primeiroEmprego; |
|
| - | 410 | }
|
|
| - | 411 | public void setPrimeiroEmprego(Boolean primeiroEmprego) { |
|
| - | 412 | this.primeiroEmprego = primeiroEmprego; |
|
| - | 413 | }
|
|
| - | 414 | ||
| - | 415 | @Column(name="ind_optante_fgts") |
|
| - | 416 | public Boolean getOptantePeloFGTS() { |
|
| - | 417 | return optantePeloFGTS; |
|
| - | 418 | }
|
|
| - | 419 | public void setOptantePeloFGTS(Boolean optantePeloFGTS) { |
|
| - | 420 | this.optantePeloFGTS = optantePeloFGTS; |
|
| - | 421 | }
|
|
| - | 422 | ||
| - | 423 | @Column(name="ind_deficiente_motora") |
|
| - | 424 | public Boolean getPessoaDeficienteMotora() { |
|
| - | 425 | return pessoaDeficienteMotora; |
|
| - | 426 | }
|
|
| - | 427 | public void setPessoaDeficienteMotora(Boolean pessoaDeficienteMotora) { |
|
| - | 428 | this.pessoaDeficienteMotora = pessoaDeficienteMotora; |
|
| - | 429 | }
|
|
| - | 430 | ||
| - | 431 | @Column(name="ind_deficiente_visual") |
|
| - | 432 | public Boolean getPessoaDeficienteVisual() { |
|
| - | 433 | return pessoaDeficienteVisual; |
|
| - | 434 | }
|
|
| - | 435 | public void setPessoaDeficienteVisual(Boolean pessoaDeficienteVisual) { |
|
| - | 436 | this.pessoaDeficienteVisual = pessoaDeficienteVisual; |
|
| - | 437 | }
|
|
| - | 438 | ||
| - | 439 | @Column(name="ind_deficiente_auditiva") |
|
| - | 440 | public Boolean getPessoaDeficienteAuditiva() { |
|
| - | 441 | return pessoaDeficienteAuditiva; |
|
| - | 442 | }
|
|
| - | 443 | public void setPessoaDeficienteAuditiva(Boolean pessoaDeficienteAuditiva) { |
|
| - | 444 | this.pessoaDeficienteAuditiva = pessoaDeficienteAuditiva; |
|
| - | 445 | }
|
|
| - | 446 | ||
| - | 447 | @Column(name="ind_reabilitado") |
|
| - | 448 | public Boolean getPessoaReabilitado() { |
|
| - | 449 | return pessoaReabilitado; |
|
| - | 450 | }
|
|
| - | 451 | public void setPessoaReabilitado(Boolean pessoaReabilitado) { |
|
| - | 452 | this.pessoaReabilitado = pessoaReabilitado; |
|
| - | 453 | }
|
|
| - | 454 | ||
| - | 455 | @Column(name="dsc_deficiente_observacao") |
|
| - | 456 | @Size(max = 200, message = "Limite de caracteres ultrapassado: OBSERVAÇÕES DA DEFICIÊNCIA") |
|
| - | 457 | public String getPessoaDeficienteObservacao() { |
|
| - | 458 | return pessoaDeficienteObservacao; |
|
| - | 459 | }
|
|
| - | 460 | public void setPessoaDeficienteObservacao(String pessoaDeficienteObservacao) { |
|
| - | 461 | this.pessoaDeficienteObservacao = StringUtil.setarUpperCaseComTrim(pessoaDeficienteObservacao);; |
|
| - | 462 | }
|
|
| - | 463 | ||
| 304 | @Column(name="dsc_nome_fantasia") |
464 | @Column(name="dsc_nome_fantasia") |
| 305 | @Size(max = 120, message = "Limite de caracteres ultrapassado: Nome Fantasia") |
465 | @Size(max = 120, message = "Limite de caracteres ultrapassado: Nome Fantasia") |
| 306 | public String getNomeFantasia() { |
466 | public String getNomeFantasia() { |
| 307 | return nomeFantasia; |
467 | return nomeFantasia; |
| 308 | }
|
468 | }
|
| Line 388... | Line 548... | ||
| 388 |
|
548 |
|
| 389 | public void setDadosBancarios(Set<DadosBancarios> dadosBancarios) {
|
549 | public void setDadosBancarios(Set<DadosBancarios> dadosBancarios) {
|
| 390 | this.dadosBancarios = dadosBancarios;
|
550 | this.dadosBancarios = dadosBancarios;
|
| 391 | }
|
551 | }
|
| 392 | */
|
552 | */
|
| - | 553 | ||
| - | 554 | @Column(name="ind_cadastro_finalizado", nullable=false) |
|
| - | 555 | public Boolean getCadastroFinalizado() { |
|
| - | 556 | return cadastroFinalizado; |
|
| - | 557 | }
|
|
| - | 558 | public void setCadastroFinalizado(Boolean cadastroFinalizado) { |
|
| - | 559 | this.cadastroFinalizado = cadastroFinalizado; |
|
| - | 560 | }
|
|
| - | 561 | ||
| 393 | @Column(name="ind_ativo", nullable=false) |
562 | @Column(name="ind_ativo", nullable=false) |
| 394 | public Boolean getAtivo() { |
563 | public Boolean getAtivo() { |
| 395 | return ativo; |
564 | return ativo; |
| 396 | }
|
565 | }
|
| 397 | 566 | ||
| 398 | public void setAtivo(Boolean ativo) { |
567 | public void setAtivo(Boolean ativo) { |
| 399 | this.ativo = ativo; |
568 | this.ativo = ativo; |
| - | 569 | }
|
|
| - | 570 | ||
| - | 571 | @Valid |
|
| - | 572 | @OneToMany(mappedBy="pessoa", cascade=CascadeType.ALL, orphanRemoval=true) |
|
| - | 573 | public List<Endereco> getEnderecos() { |
|
| - | 574 | return enderecos; |
|
| - | 575 | }
|
|
| - | 576 | public void setEnderecos(List<Endereco> enderecos) { |
|
| - | 577 | this.enderecos = enderecos; |
|
| 400 | }
|
578 | }
|
| 401 | 579 | ||
| 402 | /*******************************************************/
|
580 | /*******************************************************/
|
| 403 | 581 | ||
| 404 | @Override |
582 | @Override |