cmu.survey.data
Class TableFormat.ColumnFormatStub

java.lang.Object
  extended by cmu.survey.data.TableFormat.ColumnFormatStub
All Implemented Interfaces:
TableFormat.ColumnFormat
Direct Known Subclasses:
TableFormat.ColumnFormatRenamed
Enclosing interface:
TableFormat

public static class TableFormat.ColumnFormatStub
extends java.lang.Object
implements TableFormat.ColumnFormat


Field Summary
protected  boolean allowsNull
           
protected  java.lang.Object defaultValue
           
protected  java.lang.String name
           
protected  java.lang.Class type
           
 
Constructor Summary
TableFormat.ColumnFormatStub(java.lang.String columnName, java.lang.Class type)
           
TableFormat.ColumnFormatStub(java.lang.String columnName, java.lang.Class type, boolean allowsNull, java.lang.Object defaultValue)
          Warning: If the type=String.class, when the database is MySQL, defaultValue will fail -- according to the spec at http://dev.mysql.com/doc/mysql/en/blob.html Does anyone know why in MySQL you can't assign a default value to a blob?
TableFormat.ColumnFormatStub(java.lang.String columnName, java.lang.Class type, java.lang.Object defaultValue)
           
 
Method Summary
 boolean getAllowsNull()
           
 java.lang.Object getDefaultValue()
           
 java.lang.String getName()
           
 java.lang.Class getType()
           
 void setAllowsNull(boolean allowsNull)
           
 void setDefaultValue(java.lang.Object defaultValue)
           
 void setName(java.lang.String columnName)
           
 void setType(java.lang.Class columnType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

type

protected java.lang.Class type

allowsNull

protected boolean allowsNull

defaultValue

protected java.lang.Object defaultValue
Constructor Detail

TableFormat.ColumnFormatStub

public TableFormat.ColumnFormatStub(java.lang.String columnName,
                                    java.lang.Class type)

TableFormat.ColumnFormatStub

public TableFormat.ColumnFormatStub(java.lang.String columnName,
                                    java.lang.Class type,
                                    java.lang.Object defaultValue)
Parameters:
columnName -
type -
defaultValue -
See Also:
ColumnFormatStub(String,Class,boolean,Object)

TableFormat.ColumnFormatStub

public TableFormat.ColumnFormatStub(java.lang.String columnName,
                                    java.lang.Class type,
                                    boolean allowsNull,
                                    java.lang.Object defaultValue)
Warning: If the type=String.class, when the database is MySQL, defaultValue will fail -- according to the spec at http://dev.mysql.com/doc/mysql/en/blob.html Does anyone know why in MySQL you can't assign a default value to a blob? I can't imagine any good technical reason for that feature. We have many arbitrary length texts (for which "text" or "longtext" is really the only choice -- varchar of 255 characters is way too short for people to type in html pages, etc.). Some of these have default values to start with. Of course, the application could handle this by hand, but it would be nicer if MySQL could do it.

Parameters:
columnName -
type -
allowsNull -
defaultValue -
Method Detail

getAllowsNull

public boolean getAllowsNull()
Specified by:
getAllowsNull in interface TableFormat.ColumnFormat

setAllowsNull

public void setAllowsNull(boolean allowsNull)

getName

public java.lang.String getName()
Specified by:
getName in interface TableFormat.ColumnFormat

setName

public void setName(java.lang.String columnName)

getType

public java.lang.Class getType()
Specified by:
getType in interface TableFormat.ColumnFormat

setType

public void setType(java.lang.Class columnType)

getDefaultValue

public java.lang.Object getDefaultValue()
Specified by:
getDefaultValue in interface TableFormat.ColumnFormat

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)