diff --git a/README.md b/README.md index e7c50f0..a72bd30 100644 --- a/README.md +++ b/README.md @@ -87,27 +87,37 @@ Output: "display_size" : 3, "label" : "DEPTNO", "name" : "DEPTNO", - "type" : "CHAR" + "type" : "CHAR", + "precision" : 3, + "scale" : 0 }, { "display_size" : 36, "label" : "DEPTNAME", "name" : "DEPTNAME", - "type" : "VARCHAR" + "type" : "VARCHAR", + "precision" : 36, + "scale" : 0 }, { "display_size" : 6, "label" : "MGRNO", "name" : "MGRNO", - "type" : "CHAR" + "type" : "CHAR", + "precision" : 6, + "scale" : 0 }, { "display_size" : 3, "label" : "ADMRDEPT", "name" : "ADMRDEPT", - "type" : "CHAR" + "type" : "CHAR", + "precision" : 3, + "scale" : 0 }, { "display_size" : 16, "label" : "LOCATION", "name" : "LOCATION", - "type" : "CHAR" + "type" : "CHAR", + "precision" : 16, + "scale" : 0 } ], "job" : "930740/QUSER/QZDASOINIT" }, diff --git a/src/main/java/io/github/mapepire_ibmi/types/ColumnMetadata.java b/src/main/java/io/github/mapepire_ibmi/types/ColumnMetadata.java index 210c3ce..4579cae 100644 --- a/src/main/java/io/github/mapepire_ibmi/types/ColumnMetadata.java +++ b/src/main/java/io/github/mapepire_ibmi/types/ColumnMetadata.java @@ -30,6 +30,18 @@ public class ColumnMetadata { @JsonProperty("type") private String type; + /** + * The precision/length of the column. + */ + @JsonProperty("precision") + private int precision; + + /** + * The scale of the column. + */ + @JsonProperty("scale") + private int scale; + /** * Construct a new ColumnMetadata instance. */ @@ -39,22 +51,26 @@ public ColumnMetadata() { /** * Construct a new ColumnMetadata instance. - * + * * @param displaySize The display size of the column. * @param label The label of the column. * @param name The name of the column. * @param type The type of the column. + * @param precision The precision/length of the column. + * @param scale The scale of the column. */ - public ColumnMetadata(int displaySize, String label, String name, String type) { + public ColumnMetadata(int displaySize, String label, String name, String type, int precision, int scale) { this.displaySize = displaySize; this.label = label; this.name = name; this.type = type; + this.precision = precision; + this.scale = scale; } /** * Get the display size of the column. - * + * * @return The display size of the column. */ public int getDisplaySize() { @@ -63,7 +79,7 @@ public int getDisplaySize() { /** * Set the display size of the column. - * + * * @param displaySize The display size of the column. */ public void setDisplaySize(int displaySize) { @@ -72,7 +88,7 @@ public void setDisplaySize(int displaySize) { /** * Get the label of the column. - * + * * @return The label of the column. */ public String getLabel() { @@ -81,7 +97,7 @@ public String getLabel() { /** * Set the label of the column. - * + * * @param label The label of the column. */ public void setLabel(String label) { @@ -90,7 +106,7 @@ public void setLabel(String label) { /** * Get the name of the column. - * + * * @return The name of the column. */ public String getName() { @@ -99,7 +115,7 @@ public String getName() { /** * Set the name of the column. - * + * * @param name The name of the column. */ public void setName(String name) { @@ -108,7 +124,7 @@ public void setName(String name) { /** * Get the type of the column. - * + * * @return The type of the column. */ public String getType() { @@ -117,10 +133,46 @@ public String getType() { /** * Set the type of the column. - * + * * @param type The type of the column. */ public void setType(String type) { this.type = type; } + + /** + * Get the precision/length of the column. + * + * @return The precision/length of the column. + */ + public int getPrecision() { + return precision; + } + + /** + * Set the precision/length of the column. + * + * @param precision The precision/length of the column. + */ + public void setPrecision(int precision) { + this.precision = precision; + } + + /** + * Get the scale of the column. + * + * @return The scale of the column. + */ + public int getScale() { + return scale; + } + + /** + * Set the scale of the column. + * + * @param scale The scale of the column. + */ + public void setScale(int scale) { + this.scale = scale; + } }