Guest User

MarcaJackson

a guest
Apr 15th, 2015
212
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package model;
  2.  
  3. import com.fasterxml.jackson.annotation.JsonIdentityInfo;
  4. import com.fasterxml.jackson.annotation.JsonProperty;
  5. import com.fasterxml.jackson.annotation.ObjectIdGenerators;
  6. import java.io.Serializable;
  7. import java.util.Date;
  8. import java.util.List;
  9. import javax.persistence.Entity;
  10. import javax.persistence.Id;
  11. import javax.persistence.OneToMany;
  12. import javax.persistence.Temporal;
  13. import javax.persistence.TemporalType;
  14.  
  15. @Entity
  16. @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
  17. public class Marca implements Serializable {
  18. @Id
  19. @JsonProperty("id")
  20. private Long CodMarca;
  21. private String NomeMarca;
  22.  
  23. @Temporal(TemporalType.DATE)
  24. private Date dtfundacao;
  25.  
  26. public Date getDtfundacao() {
  27. return dtfundacao;
  28. }
  29.  
  30. @OneToMany(mappedBy = "marca")
  31. private List<Modelo> modelos;
  32.  
  33. public List<Modelo> getModelos() {
  34. return modelos;
  35. }
  36.  
  37.  
  38. public void setDtfundacao(Date dtfundacao) {
  39. this.dtfundacao = dtfundacao;
  40. }
  41.  
  42.  
  43. public Long getCodMarca() {
  44. return CodMarca;
  45. }
  46.  
  47. public void setCodMarca(Long CodMarca) {
  48. this.CodMarca = CodMarca;
  49. }
  50.  
  51. public String getNomeMarca() {
  52. return NomeMarca;
  53. }
  54.  
  55. public void setNomeMarca(String NomeMarca) {
  56. this.NomeMarca = NomeMarca;
  57. }
  58.  
  59.  
  60. }
RAW Paste Data