ItEr43S08CUImportacionRecursosProductivosItEr42S12: Resource::checkConstraintUniqueFirstNameSurnameNif provided.
The old method Resource::checkConstraintUniqueFirstName has been renamed to Resource::checkConstraintUniqueFirstNameSurnameNif to better specify its purpose. Furthermore, this method is now redefined in VirtualWorker to always return true (previously this special case was implemented in Resource::checkConstraintUniqueFirstName by using instanceof VirtualWorker).
This commit is contained in:
parent
aca51969df
commit
53d8cc7dbf
2 changed files with 7 additions and 6 deletions
|
|
@ -30,6 +30,7 @@ import org.navalplanner.business.common.Registry;
|
|||
* This class models a VirtualWorker.
|
||||
*
|
||||
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
||||
* @author Fernando Bellas Permuy <fbellas@udc.es>
|
||||
*/
|
||||
public class VirtualWorker extends Worker {
|
||||
|
||||
|
|
@ -72,6 +73,11 @@ public class VirtualWorker extends Worker {
|
|||
this.observations = observations;
|
||||
}
|
||||
|
||||
@AssertTrue
|
||||
@Override
|
||||
public boolean checkConstraintUniqueFirstNameSurnameNif() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@AssertTrue(message = "Virtual worker group name must be unique")
|
||||
public boolean checkConstraintUniqueVirtualGroupName() {
|
||||
|
|
|
|||
|
|
@ -128,12 +128,7 @@ public class Worker extends Resource {
|
|||
}
|
||||
|
||||
@AssertTrue(message = "Worker with the same first name, surname and nif previously existed")
|
||||
public boolean checkConstraintUniqueFirstName() {
|
||||
|
||||
/* Check if it makes sense to check the constraint .*/
|
||||
if (this instanceof VirtualWorker) {
|
||||
return true;
|
||||
}
|
||||
public boolean checkConstraintUniqueFirstNameSurnameNif() {
|
||||
|
||||
if (!areFirstNameSurnameNifSpecified()) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue