/* Demoiselle Framework Copyright (C) 2013 SERPRO ============================================================================ This file is part of Demoiselle Framework. Demoiselle Framework is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License version 3 along with this program; if not, see <http://www.gnu.org/licenses/> or write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ============================================================================ Este arquivo é parte do Framework Demoiselle. O Framework Demoiselle é um software livre; você pode redistribuí-lo e/ou modificá-lo dentro dos termos da GNU LGPL versão 3 como publicada pela Fundação do Software Livre (FSF). Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU/LGPL em português para maiores detalhes. Você deve ter recebido uma cópia da GNU LGPL versão 3, sob o título "LICENCA.txt", junto com esse programa. Se não, acesse <http://www.gnu.org/licenses/> ou escreva para a Fundação do Software Livre (FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA. */ package br.gov.serpro.lab.estacionamento.domain; import java.io.Serializable; import java.util.List; import javax.persistence.*; import br.gov.frameworkdemoiselle.validation.annotation.Cep; @Entity @Table(name = "tb_endereco") public class Endereco implements Serializable { private static final long serialVersionUID = 1L; @Id @Column(name = "cod_endereco") @GeneratedValue private Long codigo; @Column private String logradouro; @Column private String cidade; @Column private String estado; @Column @Cep private String cep; @ManyToMany(mappedBy="enderecos") private List<Cliente> clientes; public Endereco (){ super(); } public Endereco(String logradouro, String cidade, String estado, String cep) { super(); this.logradouro = logradouro; this.cidade = cidade; this.estado = estado; this.cep = cep; } public Endereco(String logradouro, String cidade, String estado, String cep, List<Cliente> clientes) { super(); this.logradouro = logradouro; this.cidade = cidade; this.estado = estado; this.cep = cep; this.clientes = clientes; } /** * @return the codigo */ public Long getCodigo() { return codigo; } /** * @param codigo the codigo to set */ public void setCodigo(Long codigo) { this.codigo = codigo; } /** * @return the logradouro */ public String getLogradouro() { return logradouro; } /** * @param logradouro the logradouro to set */ public void setLogradouro(String logradouro) { this.logradouro = logradouro; } /** * @return the cidade */ public String getCidade() { return cidade; } /** * @param cidade the cidade to set */ public void setCidade(String cidade) { this.cidade = cidade; } /** * @return the estado */ public String getEstado() { return estado; } /** * @param estado the estado to set */ public void setEstado(String estado) { this.estado = estado; } /** * @return the cep */ public String getCep() { return cep; } /** * @param cep the cep to set */ public void setCep(String cep) { this.cep = cep; } /** * @return the clientes */ public List<Cliente> getClientes() { return clientes; } /** * @param clientes the clientes to set */ public void setClientes(List<Cliente> clientes) { this.clientes = clientes; } }