package br.com.caelum.stella.usertype; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import org.hibernate.annotations.Type; import br.com.caelum.stella.tinytype.CEP; /** * @author Edenir Norberto Anschau * */ @Entity public class Endereco { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @Type(type = "br.com.caelum.stella.usertype.CepUserType") private CEP cep; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public CEP getCep() { return cep; } public void setCep(CEP cep) { this.cep = cep; } }