Methods Summary |
---|
public java.lang.Object | assemble(java.io.Serializable cached, java.lang.Object owner)
return cached;
|
public java.lang.Object | deepCopy(java.lang.Object value)
return value; // MonetaryAmount is immutable
|
public java.io.Serializable | disassemble(java.lang.Object value)
return (Serializable) value;
|
public boolean | equals(java.lang.Object x, java.lang.Object y)
if (x == y) return true;
if (x == null || y == null) return false;
return x.equals(y);
|
public int | hashCode(java.lang.Object x)
return x.hashCode();
|
public boolean | isMutable() return false;
|
public java.lang.Object | nullSafeGet(java.sql.ResultSet resultSet, java.lang.String[] names, java.lang.Object owner)
BigDecimal value = resultSet.getBigDecimal(names[0]);
if (resultSet.wasNull()) return null;
String cur = resultSet.getString(names[1]);
Currency userCurrency = Currency.getInstance(cur);
return new MonetaryAmount(value, userCurrency);
|
public void | nullSafeSet(java.sql.PreparedStatement statement, java.lang.Object value, int index)
if (value == null) {
statement.setNull(index, Types.NUMERIC);
statement.setNull(index+1, Types.VARCHAR);
} else {
MonetaryAmount currency = (MonetaryAmount)value;
statement.setBigDecimal(index, currency.getValue());
statement.setString(index+1, currency.getCurrency().getCurrencyCode());
}
|
public java.lang.Object | replace(java.lang.Object original, java.lang.Object target, java.lang.Object owner)
return original;
|
public java.lang.Class | returnedClass() return MonetaryAmount.class;
|
public int[] | sqlTypes()
return SQL_TYPES;
|