[Bug #1121] Fix issue adding @AssertTrue on AdvanceType entity
* Now entity checks that defaultMaxValue is greater than unitPrecision * Default value for defaultMaxValue was set to 100 (as 0 doesn't have too much sense) FEA: ItEr75S04BugFixing
This commit is contained in:
parent
ca7e470c18
commit
97390ce668
1 changed files with 10 additions and 1 deletions
|
|
@ -68,7 +68,7 @@ public class AdvanceType extends BaseEntity implements IHumanIdentifiable{
|
|||
private String unitName;
|
||||
|
||||
@NotNull
|
||||
private BigDecimal defaultMaxValue = BigDecimal.ZERO;
|
||||
private BigDecimal defaultMaxValue = new BigDecimal(100);
|
||||
|
||||
@NotNull
|
||||
private boolean updatable = true;
|
||||
|
|
@ -262,4 +262,13 @@ public class AdvanceType extends BaseEntity implements IHumanIdentifiable{
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@AssertTrue(message = "the default max value must be greater than the precision value")
|
||||
public boolean checkDefaultMaxValueGreaterThanPrecision() {
|
||||
if (defaultMaxValue.compareTo(unitPrecision) == -1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue