From d6a0f67b5754a43f7ef6acd411153a5ff9c4b0c1 Mon Sep 17 00:00:00 2001 From: alindo Date: Tue, 26 Nov 2024 21:18:23 +0000 Subject: [PATCH] fixed error when decimal or numeric type dont have precision or scale --- .../model/structure/type/SimpleTypeNumericExact.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dbptk-model/src/main/java/com/databasepreservation/model/structure/type/SimpleTypeNumericExact.java b/dbptk-model/src/main/java/com/databasepreservation/model/structure/type/SimpleTypeNumericExact.java index 557ee5efc..2d191d803 100644 --- a/dbptk-model/src/main/java/com/databasepreservation/model/structure/type/SimpleTypeNumericExact.java +++ b/dbptk-model/src/main/java/com/databasepreservation/model/structure/type/SimpleTypeNumericExact.java @@ -21,6 +21,9 @@ public class SimpleTypeNumericExact extends Type { private Integer scale; + private static final Integer SIMPLE_TYPE_NUMERIC_EXACT_DEFAULT_PRECISION = 53; + private static final Integer SIMPLE_TYPE_NUMERIC_EXACT_DEFAULT_SCALE = 10; + /** * Exact numeric, like int or integer */ @@ -37,8 +40,13 @@ public SimpleTypeNumericExact() { * the number of digits after the radix point (optional) */ public SimpleTypeNumericExact(Integer precision, Integer scale) { - this.precision = precision; - this.scale = scale; + if (precision == 0 && scale == 0) { + this.precision = SIMPLE_TYPE_NUMERIC_EXACT_DEFAULT_PRECISION; + this.scale = SIMPLE_TYPE_NUMERIC_EXACT_DEFAULT_SCALE; + } else { + this.precision = precision; + this.scale = scale; + } } /**