#442 - @JsonIgnore / @Expose ... not working on @OneToMany or @ManyToMany - was - @Transient field on @MappedSuperclass is not ignored by toJson()

This commit is contained in:
Robin Bygrave
2015-10-28 09:10:19 +13:00
parent 3d62f58930
commit 67c711d75f
4 changed files with 47 additions and 27 deletions
@@ -1,6 +1,7 @@
package com.avaje.tests.model.info;
import com.avaje.ebean.Model;
import com.avaje.ebean.annotation.JsonIgnore;
import javax.persistence.*;
import java.util.ArrayList;
@@ -19,6 +20,7 @@ public class InfoCompany extends Model {
String name;
@JsonIgnore
@OneToMany(mappedBy = "company", cascade = CascadeType.ALL)
List<InfoContact> contacts = new ArrayList<InfoContact>();
@@ -2,7 +2,11 @@ package com.avaje.tests.model.info;
import com.avaje.ebean.Model;
import javax.persistence.*;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Version;
@Entity
public class InfoCustomer extends Model {