org.melati.poem
Class AtomPoemType<T>

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

public abstract class AtomPoemType<T>
extends BasePoemType<T>

Base class for all atomic types.

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


Field Summary
protected  String sqlTypeName
           
 
Fields inherited from class org.melati.poem.BasePoemType
nullable
 
Constructor Summary
AtomPoemType(int sqlTypeCode, String sqlTypeName, boolean nullable)
          Constructor.
 
Method Summary
protected  void _assertValidCooked(Object cooked)
           
protected  Object _cookedOfRaw(Object raw)
          Returns the given value unchanged.
protected  String _quotedRaw(Object raw)
           
protected  Object _rawOfCooked(Object cooked)
          Returns the given value unchanged.
protected  String _sqlDefinition(Dbms dbms)
           
protected  String _stringOfCooked(Object cooked, PoemLocale locale, int style)
           
protected  String _stringOfRaw(Object raw)
           
protected  String _toString()
           
 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 String sqlTypeName
Constructor Detail

AtomPoemType

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

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

_quotedRaw

protected String _quotedRaw(Object raw)
Specified by:
_quotedRaw in class BasePoemType<T>

_stringOfRaw

protected String _stringOfRaw(Object raw)
Specified by:
_stringOfRaw in class BasePoemType<T>

_assertValidCooked

protected void _assertValidCooked(Object cooked)
                           throws ValidationPoemException
Specified by:
_assertValidCooked in class BasePoemType<T>
Throws:
ValidationPoemException

_cookedOfRaw

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

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

_rawOfCooked

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

Specified by:
_rawOfCooked in class BasePoemType<T>

_stringOfCooked

protected String _stringOfCooked(Object cooked,
                                 PoemLocale locale,
                                 int style)
Specified by:
_stringOfCooked in class BasePoemType<T>

_sqlDefinition

protected String _sqlDefinition(Dbms dbms)
Specified by:
_sqlDefinition in class BasePoemType<T>

sqlDefaultValue

public 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 String _toString()
Specified by:
_toString in class BasePoemType<T>


Copyright © 2000-2010 PanEris. All Rights Reserved.