package models;

import javax.persistence.*;

@Entity
@Table(name = "groups")
public class Group {
    @Id
    @GeneratedValue
    @Column(name = "group_id")
    private int id;

    @Column(nullable = false)
    private String name;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "id")
    @Column(nullable = false)
    private GroupType type;

    @Column
    private String description;

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "file_id")
    @Column
    private File photo;

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public GroupType getType() {
        return type;
    }

    public void setType(GroupType type) {
        this.type = type;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public File getPhoto() {
        return photo;
    }

    public void setPhoto(File photo) {
        this.photo = photo;
    }
}

@@ -507,16 +507,273 @@
 e photo;
+%0A    %0A    @ManyToMany(fetch = FetchType.LAZY)%0A    @JoinTable(%0A            name = %22members%22,%0A            joinColumns = %7B@JoinColumn(name = %22group_id%22)%7D,%0A            inverseJoinColumns = %7B@JoinColumn(name = %22person_id%22)%7D%0A    )%0A    private Set%3CPerson%3E members;
 %0A%0A    pu
@@ -1386,10 +1386,83 @@
 ;%0A    %7D%0A
+    %0A    public Set%3CPerson%3E getMembers() %7B%0A        return members;%0A    %7D%0A
 %7D%0A

Update Group.java - many to many?