1 package org.jbpm.identity; 2 3 import java.io.*; 4 5 14 public class Membership extends Entity implements Serializable { 15 16 private static final long serialVersionUID = 1L; 17 18 protected String role = null; 19 protected User user = null; 20 protected Group group = null; 21 22 24 public Membership() { 25 } 26 27 public static Membership create(User user, String name, Group group) { 28 Membership membership = create(user, group); 29 membership.name = name; 30 return membership; 31 } 32 33 public static Membership create(User user, Group group) { 34 Membership membership = new Membership(); 35 user.addMembership(membership); 36 group.addMembership(membership); 37 return membership; 38 } 39 40 public void setUser(User user) { 42 this.user = user; 43 } 44 public void setGroup(Group group) { 45 this.group = group; 46 } 47 48 50 public long getId() { 51 return id; 52 } 53 public Group getGroup() { 54 return group; 55 } 56 public User getUser() { 57 return user; 58 } 59 public String getRole() { 60 return role; 61 } 62 public void setRole(String role) { 63 this.role = role; 64 } 65 } 66 | Popular Tags |