@author Tomas Muller
| 47 | * @author Tomas Muller |
| 48 | */ |
| 49 | @Entity |
| 50 | @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) |
| 51 | @Table(name = "solver_group") |
| 52 | public class SolverGroup extends BaseSolverGroup implements Comparable, Qualifiable { |
| 53 | private static final long serialVersionUID = 1L; |
| 54 | |
| 55 | /*[CONSTRUCTOR MARKER BEGIN]*/ |
| 56 | public SolverGroup () { |
| 57 | super(); |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Constructor for primary key |
| 62 | */ |
| 63 | public SolverGroup (Long uniqueId) { |
| 64 | super(uniqueId); |
| 65 | } |
| 66 | |
| 67 | /*[CONSTRUCTOR MARKER END]*/ |
| 68 | |
| 69 | @Transient |
| 70 | public boolean isExternalManager(){ |
| 71 | for(Iterator i=getDepartments().iterator();i.hasNext();) { |
| 72 | Department d = (Department)i.next(); |
| 73 | if (d.isExternalManager().booleanValue()) return true; |
| 74 | } |
| 75 | return false; |
| 76 | } |
| 77 | |
| 78 | @Transient |
| 79 | public Collection getClasses() { |
| 80 | Vector classes = new Vector(); |
| 81 | for (Iterator i=getDepartments().iterator();i.hasNext();) { |
| 82 | Department d = (Department)i.next(); |
| 83 | classes.addAll(d.getClasses()); |
| 84 | } |
| 85 | return classes; |
| 86 | } |
| 87 | |
| 88 | public Collection getNotAssignedClasses(Solution solution) { |
| 89 | Vector classes = new Vector(); |
| 90 | for (Iterator i=getDepartments().iterator();i.hasNext();) { |
| 91 | Department d = (Department)i.next(); |
| 92 | classes.addAll(d.getNotAssignedClasses(solution)); |
| 93 | } |
| 94 | return classes; |
| 95 | } |
| 96 | @Transient |
| 97 | public Set getDistributionPreferences() { |
| 98 | TreeSet prefs = new TreeSet(); |
| 99 | for (Iterator i=getDepartments().iterator();i.hasNext();) { |
| 100 | Department d = (Department)i.next(); |
| 101 | prefs.addAll(d.getDistributionPreferences()); |
| 102 | } |
| 103 | return prefs; |
| 104 | } |
| 105 | |
| 106 | public static Set<SolverGroup> findBySessionId(Long sessionId) { |
nothing calls this directly
no outgoing calls
no test coverage detected