title: rest - json response has an unknown field
body: <p>I setup a rest webservice with different resources. </p>
  
  <p>One of them is customers which can be accessed via /api/customers</p>
  
  <p>The customer class has an id, address, name and email field but for some reason the json response looks like this:</p>
  
  <pre><code>{
  "type": "customer",
  "address": {
    "city": "Kottes-Purk",
    "country": "Pakistan",
    "street": "Julius-Raab-Straße 008"
  },
  "email": "hana.lammert@hotmail.com",
  "name": "Prof. Dr. David Mikitenko"
  }
  </code></pre>
  
  <p>i dont know why there is a "type" field in the json response. Could someone explain why it's there?</p>
  
  <p>The customer class looks like this:</p>
  
  <pre><code>@XmlRootElement
  @Entity
  @Table(name = "customers")
  public class Customer extends Model {
  
  @Id
  @GeneratedValue(strategy=GenerationType.AUTO)
  private int id;
  
  @Column(name = "name")
  private String name;
  
  @Column(name = "email")
  private String email;
  
  @ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.ALL})
  @JoinColumn(name = "address_id")
  private Address address;
  
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
  private List&lt;Booking&gt; bookings;
  
  public Customer() {}
  
  public Customer(String email, Address address, String name) {
      this.email = email;
      this.address = address;
      this.name = name;
  }
  
  
  
  public int setId() {
      return id;
  }
  
  public int getId() {
      return id;
  }
  
  
  public String getName() {
      return name;
  }
  
  
  public void setName(String name) {
      this.name = name;
  }
  
  
  public String getEmail() {
      return email;
  }
  
  
  public void setEmail(String email) {
      this.email = email;
  }
  
  
  public Address getAddress() {
      return address;
  }
  
  
  public void setAddress(Address address) {
      this.address = address;
  }
  
  
  @XmlTransient
  public List&lt;Booking&gt; getBookings() {
      return bookings;
  }
  
  public void setBookings(List&lt;Booking&gt; bookings) {
      this.bookings = bookings;
  }
  
  
  public static List&lt;Customer&gt; all() {
      return (List&lt;Customer&gt;) Database.all(Customer.class);
  }
  
  
  public static Customer find(int id) {
      return (Customer) Database.find(Customer.class, id);
  }
  
  
  public static boolean exists(int id) {
      return Database.exists(Customer.class, id);
  }
  
  
  public static List&lt;Customer&gt; where(String column, String value) {
      return (List&lt;Customer&gt;) Database.where(Customer.class, column, value);
  }
  
  }
  </code></pre>
  
  <p>In the CustomerResource class:</p>
  
  <pre><code>@GET
  @Produces(MediaType.APPLICATION_JSON)
  public List&lt;Customer&gt; getCustomers(){
      return agencyManager.getCustomers();
  }
  </code></pre>
  
  <p>What am I missing here? thank you </p>
  
  <p>Model class:</p>
  
  <pre><code>public abstract class Model implements Serializable {
  
  
  public void save() {
      EntityManager entityManager = HibernateUtil.getEntityManagerFactory().createEntityManager();
      entityManager.getTransaction().begin();
      entityManager.persist(this);
      entityManager.getTransaction().commit();
      entityManager.close();
  }
  
  
  public void delete() {
      EntityManager entityManager = HibernateUtil.getEntityManagerFactory().createEntityManager();
      entityManager.getTransaction().begin();
      entityManager.remove(entityManager.contains(this) ? this : entityManager.merge(this));
      entityManager.getTransaction().commit();
      entityManager.close();
  }
  }
  </code></pre>