package com.yammer.stresstime.entities;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

@Entity
@Table(name = "memberships")
public class Membership {

    public Membership() {
        // Required by Hibernate
    }
    public Membership(Employee employee, Group group) {
        setEmployee(employee);
        setGroup(group);
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long mId;

    @ManyToOne
    @JoinColumn(name = "employee_id")
    private Employee mEmployee;

    @ManyToOne
    @JoinColumn(name = "group_id")
    private Group mGroup;

    @Column(name = "admin")
    @NotNull
    private boolean mAdmin = false;

    public long getId() {
        return mId;
    }

    public Employee getEmployee() {
        return mEmployee;
    }

    public void setEmployee(Employee employee) {
        mEmployee = employee;
    }

    public Group getGroup() {
        return mGroup;
    }

    public void setGroup(Group group) {
        mGroup = group;
    }

    public boolean isAdmin() {
        return mAdmin;
    }

    public void setAdmin(boolean admin) {
        mAdmin = admin;
    }
}

@@ -172,30 +172,45 @@
 ship %7B%0A%0A    
-public
+/* package private */
  Membership(
@@ -252,16 +252,17 @@
 e%0A    %7D%0A
+%0A
     publ
@@ -317,27 +317,25 @@
         
-set
+m
 Employee
 (employe
@@ -330,17 +330,19 @@
 oyee
-(
+ = 
 employee
 );%0A 
@@ -337,17 +337,16 @@
 employee
-)
 ;%0A      
@@ -351,23 +351,22 @@
     
-set
+m
 Group
-(
+ = 
 group
-)
 ;%0A  

Change constructor of Membership to package private