ItEr39S16CUConfiguracionMaquinasItEr35S09: Pushing up detaching common part
This commit is contained in:
parent
7f9432d4e5
commit
311be9b945
3 changed files with 8 additions and 8 deletions
|
|
@ -141,6 +141,11 @@ public abstract class DayAssignment extends BaseEntity {
|
|||
getResource().addNewAssignments(Arrays.asList(this));
|
||||
}
|
||||
|
||||
abstract void detach();
|
||||
final void detach() {
|
||||
getResource().removeAssignments(Arrays.asList(this));
|
||||
detachFromAllocation();
|
||||
}
|
||||
|
||||
protected abstract void detachFromAllocation();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
package org.navalplanner.business.planner.entities;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
|
@ -81,10 +80,8 @@ public class GenericDayAssignment extends DayAssignment {
|
|||
this.genericResourceAllocation = genericResourceAllocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
void detach() {
|
||||
protected void detachFromAllocation() {
|
||||
genericResourceAllocation = null;
|
||||
getResource().removeAssignments(Arrays.asList(this));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
|
||||
package org.navalplanner.business.planner.entities;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
|
@ -83,8 +82,7 @@ public class SpecificDayAssignment extends DayAssignment {
|
|||
}
|
||||
|
||||
@Override
|
||||
void detach() {
|
||||
protected void detachFromAllocation() {
|
||||
this.specificResourceAllocation = null;
|
||||
getResource().removeAssignments(Arrays.asList(this));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue