org.melati.poem
Class BigDecimalPoemType

Package class diagram package BigDecimalPoemType
java.lang.Object
  extended by org.melati.poem.BasePoemType<T>
      extended by org.melati.poem.AtomPoemType
          extended by org.melati.poem.FixedPointAtomPoemType
              extended by org.melati.poem.BigDecimalPoemType
All Implemented Interfaces:
Cloneable, PoemType, SQLPoemType, SQLType

public class BigDecimalPoemType
extends FixedPointAtomPoemType

Java "BigDecimal", dependant upon the database/SQL implementation. By default, this is a 22 digit number, with 2 digits after the decimal.


Field Summary
 
Fields inherited from class org.melati.poem.AtomPoemType
sqlTypeName
 
Fields inherited from class org.melati.poem.BasePoemType
nullable
 
Constructor Summary
BigDecimalPoemType(boolean nullable)
          Constructor.
BigDecimalPoemType(boolean nullable, int precision, int scale)
          Constructor.
 
Method Summary
protected  void _assertValidRaw(Object raw)
           
protected  boolean _canRepresent(SQLPoemType other)
          Whilst BigDecimal cannot represent all Doubles it can represent legacy money doubles, so we allow it to enable upgrades from Doubles to BigDecimals.
protected  Object _getRaw(ResultSet rs, int col)
           
protected  Object _rawOfString(String rawString)
          Converts a non-null string to an appropriate value for insertion into the underlying DBMS.
protected  void _saveColumnInfo(ColumnInfo columnInfo)
           
protected  void _setRaw(PreparedStatement ps, int col, Object real)
           
protected  String _sqlDefinition(Dbms dbms)
           
 String toDsdType()
          The field type used in the Data Structure Definition language.
 
Methods inherited from class org.melati.poem.FixedPointAtomPoemType
getPrecision, getScale, getTotalSize, setPrecision, setScale, withPrecisionAndScale
 
Methods inherited from class org.melati.poem.AtomPoemType
_assertValidCooked, _cookedOfRaw, _quotedRaw, _rawOfCooked, _stringOfCooked, _stringOfRaw, _toString, sqlDefaultValue
 
Methods inherited from class org.melati.poem.BasePoemType
_possibleRaws, assertValidCooked, assertValidRaw, canRepresent, clone, cookedOfRaw, getLimitRaw, getLowRaw, getNullable, getRaw, possibleRaws, quotedRaw, rawOfCooked, rawOfString, saveColumnInfo, setRaw, setRawRange, sqlDefinition, sqlTypeCode, sqlTypeDefinition, stringOfCooked, stringOfRaw, toString, withNullable
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BigDecimalPoemType

public BigDecimalPoemType(boolean nullable)
Constructor.

Parameters:
nullable - whether nullable

BigDecimalPoemType

public BigDecimalPoemType(boolean nullable,
                          int precision,
                          int scale)
Constructor.

Parameters:
nullable - whether nullable
precision - defaults to 22
scale - defaults to 2
Method Detail

_assertValidRaw

protected void _assertValidRaw(Object raw)
Specified by:
_assertValidRaw in class BasePoemType

_getRaw

protected Object _getRaw(ResultSet rs,
                         int col)
                  throws SQLException
Specified by:
_getRaw in class BasePoemType
Throws:
SQLException

_setRaw

protected void _setRaw(PreparedStatement ps,
                       int col,
                       Object real)
                throws SQLException
Specified by:
_setRaw in class BasePoemType
Throws:
SQLException

_rawOfString

protected Object _rawOfString(String rawString)
                       throws ParsingPoemException
Description copied from class: BasePoemType
Converts a non-null string to an appropriate value for insertion into the underlying DBMS.

Specified by:
_rawOfString in class BasePoemType
Throws:
ParsingPoemException

_sqlDefinition

protected String _sqlDefinition(Dbms dbms)
Overrides:
_sqlDefinition in class AtomPoemType

_canRepresent

protected boolean _canRepresent(SQLPoemType other)
Whilst BigDecimal cannot represent all Doubles it can represent legacy money doubles, so we allow it to enable upgrades from Doubles to BigDecimals.

Specified by:
_canRepresent in class BasePoemType
See Also:
BasePoemType._canRepresent(org.melati.poem.SQLPoemType)

toDsdType

public String toDsdType()
Description copied from interface: PoemType
The field type used in the Data Structure Definition language.

Returns:
the field type used in the Data Structure Definition language.

_saveColumnInfo

protected void _saveColumnInfo(ColumnInfo columnInfo)
                        throws AccessPoemException
Specified by:
_saveColumnInfo in class BasePoemType
Throws:
AccessPoemException


Copyright © 2000-2010 PanEris. All Rights Reserved.