org.melati.poem
Class AtomPoemType

java.lang.Object
  extended by org.melati.poem.BasePoemType
      extended by org.melati.poem.AtomPoemType
All Implemented Interfaces:
java.lang.Cloneable, PoemType, SQLPoemType, SQLType
Direct Known Subclasses:
BooleanPoemType, DatePoemType, DoublePoemType, FixedPointAtomPoemType, IntegerPoemType, LongPoemType, SizedAtomPoemType, TimestampPoemType

public abstract class AtomPoemType
extends BasePoemType

Base class for all atomic types.

Currently all types, as generated classes are instances of IntegerPoemType.


Field Summary
protected  java.lang.String sqlTypeName
           
 
Fields inherited from class org.melati.poem.BasePoemType
nullable
 
Constructor Summary
AtomPoemType(int sqlTypeCode, java.lang.String sqlTypeName, boolean nullable)
          Constructor.
 
Method Summary
protected  void _assertValidCooked(java.lang.Object cooked)
           
protected  java.lang.Object _cookedOfRaw(java.lang.Object raw)
          Returns the given value unchanged.
protected  java.lang.String _quotedRaw(java.lang.Object raw)
           
protected  java.lang.Object _rawOfCooked(java.lang.Object cooked)
          Returns the given value unchanged.
protected  java.lang.String _sqlDefinition(Dbms dbms)
           
protected  java.lang.String _stringOfCooked(java.lang.Object cooked, PoemLocale locale, int style)
           
protected  java.lang.String _stringOfRaw(java.lang.Object raw)
           
protected  java.lang.String _toString()
           
 java.lang.String sqlDefaultValue(Dbms dbms)
          Used to set a not null value when creating a non nullable column.
 
Methods inherited from class org.melati.poem.BasePoemType
_assertValidRaw, _canRepresent, _getRaw, _possibleRaws, _rawOfString, _saveColumnInfo, _setRaw, 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
 
Methods inherited from interface org.melati.poem.PoemType
toDsdType
 

Field Detail

sqlTypeName

protected java.lang.String sqlTypeName
Constructor Detail

AtomPoemType

public AtomPoemType(int sqlTypeCode,
                    java.lang.String sqlTypeName,
                    boolean nullable)
Constructor.

Parameters:
sqlTypeCode - from Types
sqlTypeName - SQL Type name
nullable - whether null is an allowed value
Method Detail

_quotedRaw

protected java.lang.String _quotedRaw(java.lang.Object raw)
Specified by:
_quotedRaw in class BasePoemType

_stringOfRaw

protected java.lang.String _stringOfRaw(java.lang.Object raw)
Specified by:
_stringOfRaw in class BasePoemType

_assertValidCooked

protected void _assertValidCooked(java.lang.Object cooked)
                           throws ValidationPoemException
Specified by:
_assertValidCooked in class BasePoemType
Throws:
ValidationPoemException

_cookedOfRaw

protected java.lang.Object _cookedOfRaw(java.lang.Object raw)
                                 throws PoemException
Returns the given value unchanged.

Specified by:
_cookedOfRaw in class BasePoemType
Parameters:
raw - the base object or Integer object id
Returns:
the unchanged base object or an instantiated type
Throws:
PoemException

_rawOfCooked

protected java.lang.Object _rawOfCooked(java.lang.Object cooked)
Returns the given value unchanged.

Specified by:
_rawOfCooked in class BasePoemType

_stringOfCooked

protected java.lang.String _stringOfCooked(java.lang.Object cooked,
                                           PoemLocale locale,
                                           int style)
Specified by:
_stringOfCooked in class BasePoemType

_sqlDefinition

protected java.lang.String _sqlDefinition(Dbms dbms)
Specified by:
_sqlDefinition in class BasePoemType

sqlDefaultValue

public java.lang.String sqlDefaultValue(Dbms dbms)
Used to set a not null value when creating a non nullable column.

Parameters:
dbms - the dbms the value is suitable for
Returns:
a String suitable for substitution in UPDATE table SET field = ?
See Also:
org.melati.poem.SQLType#sqlDefaultValue()

_toString

protected java.lang.String _toString()
Specified by:
_toString in class BasePoemType


Copyright © 2000-2009 PanEris. All Rights Reserved.