| .. | .. |
|---|
| 10 | 10 | import javax.persistence.FetchType; |
|---|
| 11 | 11 | import javax.persistence.GeneratedValue; |
|---|
| 12 | 12 | import javax.persistence.Id; |
|---|
| 13 | +import javax.persistence.JoinColumn; |
|---|
| 14 | +import javax.persistence.JoinTable; |
|---|
| 15 | +import javax.persistence.ManyToMany; |
|---|
| 13 | 16 | import javax.persistence.NamedQueries; |
|---|
| 14 | 17 | import javax.persistence.NamedQuery; |
|---|
| 15 | 18 | import javax.persistence.OneToMany; |
|---|
| .. | .. |
|---|
| 68 | 71 | @JsonManagedReference |
|---|
| 69 | 72 | private Set<ApplicationMetadata> metadata; |
|---|
| 70 | 73 | |
|---|
| 74 | + @JsonIgnore |
|---|
| 75 | + // We don't include the users to limit the size of each row a the listing |
|---|
| 76 | + @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE) |
|---|
| 77 | + @JoinTable(name = "user_application", // |
|---|
| 78 | + joinColumns = { @JoinColumn(name = "application_id", referencedColumnName = "id") }, // |
|---|
| 79 | + inverseJoinColumns = { @JoinColumn(name = "username", referencedColumnName = "username") }) |
|---|
| 80 | + private Set<User> users; |
|---|
| 81 | + |
|---|
| 71 | 82 | public Integer getId() { |
|---|
| 72 | 83 | return id; |
|---|
| 73 | 84 | } |
|---|