Guest User

JacksonModelo

a guest
Apr 15th, 2015
53
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 javax.persistence.Entity;
  8. import javax.persistence.Id;
  9. import javax.persistence.ManyToOne;
  10.  
  11. @Entity
  12. @JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="id")
  13. public class Modelo implements Serializable {
  14. @Id
  15. @JsonProperty("id")
  16. private Long CodModelo;
  17. private String DescricaoModelo;
  18.  
  19. @ManyToOne
  20. private Marca marca;
  21.  
  22. public Marca getMarca() {
  23. return marca;
  24. }
  25.  
  26. public void setMarca(Marca marca) {
  27. this.marca = marca;
  28. }
  29.  
  30.  
  31. public Long getCodModelo() {
  32. return CodModelo;
  33. }
  34.  
  35. public void setCodModelo(Long CodModelo) {
  36. this.CodModelo = CodModelo;
  37. }
  38.  
  39. public String getDescricaoModelo() {
  40. return DescricaoModelo;
  41. }
  42.  
  43. public void setDescricaoModelo(String DescricaoModelo) {
  44. this.DescricaoModelo = DescricaoModelo;
  45. }
  46. }
RAW Paste Data