org.umber.catalan.transform.text
Class SqlTable.Field

java.lang.Object
  extended byorg.umber.catalan.transform.text.SqlTable.Field
Enclosing class:
SqlTable

public static class SqlTable.Field
extends java.lang.Object

A single field in an SQL table.

Author:
jsheets

Constructor Summary
SqlTable.Field()
          Creates a new instance of Field.
SqlTable.Field(boolean usePrimitiveType, java.util.Map customTypes)
          Creates a new instance of Field with the specified primitive types policy.
 
Method Summary
 java.lang.String getCheckCondition()
          Retrieves the CHECK condition for this field.
 java.lang.String getDefaultValue()
          Retrieves the default value for this field.
 java.lang.String getJavaType()
          Retrieves the Java data type for this field.
 java.lang.String getName()
          Retrieves the name of this field.
 PropertyName getNameProperty()
          Retrieves the name of this field as a PropertyName object.
 java.lang.String getSqlType()
          Retrieves the SQL data type for this field.
 boolean isNullable()
          Determines if this field can contain null values
 boolean isUnique()
          Determines if this field must contain a unique value among all fields in the table.
 void setCheckCondition(java.lang.String check)
          Assigns the CHECK condition for this field.
 void setDefaultValue(java.lang.String defaultValue)
          Assigns the default value for this field.
 void setName(java.lang.String name)
          Assigns the name of this field.
 void setNullable(boolean nullable)
          Assigns the nullability of this field.
 void setSqlType(java.lang.String sqlType)
          Assigns the SQL data type for this field.
 void setUnique(boolean unique)
          Assigns unique nature of field in its table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlTable.Field

public SqlTable.Field()
Creates a new instance of Field.


SqlTable.Field

public SqlTable.Field(boolean usePrimitiveType,
                      java.util.Map customTypes)
Creates a new instance of Field with the specified primitive types policy.

Parameters:
usePrimitiveType - if true, use primitive types, not object wrappers.
customTypes - a Map of SQL types to Java types, or null if no custom types
Method Detail

getCheckCondition

public java.lang.String getCheckCondition()
Retrieves the CHECK condition for this field.

Returns:
field CHECK condition

setCheckCondition

public void setCheckCondition(java.lang.String check)
Assigns the CHECK condition for this field.

Parameters:
check - field CHECK condition

getDefaultValue

public java.lang.String getDefaultValue()
Retrieves the default value for this field.

Returns:
field DEFAULT value

setDefaultValue

public void setDefaultValue(java.lang.String defaultValue)
Assigns the default value for this field.

Parameters:
defaultValue - field DEFAULT value

getName

public java.lang.String getName()
Retrieves the name of this field.

Returns:
field name

getNameProperty

public PropertyName getNameProperty()
Retrieves the name of this field as a PropertyName object.

Returns:
field name

setName

public void setName(java.lang.String name)
Assigns the name of this field.

Parameters:
name - field name

isNullable

public boolean isNullable()
Determines if this field can contain null values

Returns:
true if the field can contain a null value

setNullable

public void setNullable(boolean nullable)
Assigns the nullability of this field.

Parameters:
nullable - true if the field can contain a null value

getSqlType

public java.lang.String getSqlType()
Retrieves the SQL data type for this field.

Returns:
SQL data type

getJavaType

public java.lang.String getJavaType()
Retrieves the Java data type for this field. If the SQL data type does not map to a known type, returns Object.class.

Returns:
Java data type

setSqlType

public void setSqlType(java.lang.String sqlType)
Assigns the SQL data type for this field.

Parameters:
sqlType - SQL data type

isUnique

public boolean isUnique()
Determines if this field must contain a unique value among all fields in the table.

Returns:
true if field must be unique in table

setUnique

public void setUnique(boolean unique)
Assigns unique nature of field in its table.

Parameters:
unique - true if field must be unique in table