예제 #1
0
  /**
   * Called when setting a DECIMAL value internally or from through a procedure or function. Handles
   * long in addition to BigDecimal to handle identity being stored as a long but returned as a
   * DECIMAL.
   */
  public void setValue(Number theValue) throws StandardException {
    if (SanityManager.ASSERT) {
      if (theValue != null
          && !(theValue instanceof java.math.BigDecimal)
          && !(theValue instanceof java.lang.Long))
        SanityManager.THROWASSERT("SQLDecimal.setValue(Number) passed a " + theValue.getClass());
    }

    if (theValue instanceof BigDecimal || theValue == null) setCoreValue((BigDecimal) theValue);
    else setValue(theValue.longValue());
  }
예제 #2
0
 /** @see NumberDataValue#setValue */
 public void setValue(int theValue) {
   setValue((long) theValue);
 }
예제 #3
0
 /**
  * Set the value from a correctly typed BigDecimal object.
  *
  * @throws StandardException
  */
 void setObject(Object theValue) throws StandardException {
   setValue((BigDecimal) theValue);
 }