Class GcTableSyncColumnMetadata

java.lang.Object
edu.internet2.middleware.grouperClient.jdbc.tableSync.GcTableSyncColumnMetadata

public class GcTableSyncColumnMetadata extends Object
  • Constructor Details

    • GcTableSyncColumnMetadata

      public GcTableSyncColumnMetadata()
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • normalizeBigDecimal

      public static BigDecimal normalizeBigDecimal(BigDecimal bigDecimal)

      Normalize a BigDecimal so that numerically equal values are also equal by equals(). e.g. 5, 5.0, and 5.00 all become 5. Note that BigDecimal.equals() and BigDecimal.hashCode() are scale sensitive, and those are what the table sync compares are based on.

      Parameters:
      bigDecimal -
      Returns:
      the normalized big decimal
    • normalizeValue

      public Object normalizeValue(Object input)

      Convert a value to the canonical java type for this column so that values which come from different places can be compared with equals()/hashCode(). The two sides of a sync can be different database vendors (and therefore different jdbc drivers), or one side can be java objects passed in programmatically (e.g. GcTableSyncFromData), so the same logical value can arrive as an Integer, a Long, a BigDecimal, a String, a java.util.Date, etc. Without this the compare reports a difference and the row is updated on every run.

      This is best effort and never throws. If the value cannot be converted it is returned unchanged so that behavior does not regress for types which are not handled here.

      Parameters:
      input -
      Returns:
      the normalized value
    • isDateOnly

      public boolean isDateOnly()
      true if this column is a SQL DATE (i.e. has no time part) as opposed to a SQL TIMESTAMP
      Returns:
      the dateOnly
    • setDateOnly

      public void setDateOnly(boolean dateOnly1)
      true if this column is a SQL DATE (i.e. has no time part) as opposed to a SQL TIMESTAMP
      Parameters:
      dateOnly1 - the dateOnly to set
    • getColumnIndexZeroIndexed

      public int getColumnIndexZeroIndexed()
      column index zero indexed
      Returns:
      the columnIndexZeroIndexed
    • setColumnIndexZeroIndexed

      public void setColumnIndexZeroIndexed(int columnIndexZeroIndexed1)
      Parameters:
      columnIndexZeroIndexed1 - the columnIndexZeroIndexed to set
    • getPrecision

      public int getPrecision()
      precision of number in database
      Returns:
      the precision
    • setPrecision

      public void setPrecision(int precision1)
      precision of number in database
      Parameters:
      precision1 - the precision to set
    • getScale

      public int getScale()
      scale of number in database
      Returns:
      the scale
    • setScale

      public void setScale(int scale1)
      scale of number in database
      Parameters:
      scale1 - the scale to set
    • getColumnDisplaySize

      public int getColumnDisplaySize()
      length of string cols
      Returns:
      the stringLength
    • setColumnDisplaySize

      public void setColumnDisplaySize(int stringLength1)
      length of string cols
      Parameters:
      stringLength1 - the stringLength to set
    • getColumnType

      public GcTableSyncColumnMetadata.ColumnType getColumnType()
      type of column
      Returns:
      the columnType
    • setColumnType

      public void setColumnType(GcTableSyncColumnMetadata.ColumnType columnType1)
      type of column
      Parameters:
      columnType1 - the columnType to set
    • getColumnName

      public String getColumnName()
      name of column
      Returns:
      the columnName
    • setColumnName

      public void setColumnName(String columnName1)
      name of column
      Parameters:
      columnName1 - the columnName to set