net.sourceforge.sql2java
Class Column

java.lang.Object
  extended by net.sourceforge.sql2java.Column
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
IndexColumn

public class Column
extends java.lang.Object
implements java.lang.Cloneable


Field Summary
static int M_ARRAY
           
static int M_BIGDECIMAL
           
static int M_BLOB
           
static int M_BOOLEAN
           
static int M_BYTES
           
static int M_CALENDAR
           
static int M_CLOB
           
static int M_DOUBLE
           
static int M_FLOAT
           
static int M_INTEGER
           
static int M_LONG
           
static int M_OBJECT
           
static int M_REF
           
static int M_SQLDATE
           
static int M_STRING
           
static int M_TIME
           
static int M_TIMESTAMP
           
static int M_URL
           
static int M_UTILDATE
           
 
Constructor Summary
Column()
           
 
Method Summary
 void addForeignKey(Column col)
           
 void addImportedKey(Column col)
           
 java.lang.Object clone()
           
 boolean columnFor(java.lang.String webElement)
          is this column described to be in the given type ?
 java.lang.String convertName()
           
 java.lang.String convertName(Column col)
           
 java.lang.String convertName(java.lang.String columnName)
           
 int countForeignKeys()
           
 int countImportedKeys()
           
 java.lang.String getCatalog()
           
 java.lang.String getCheckingType()
           
 java.lang.String getConstName()
           
 int getDecimalDigits()
           
 boolean getDefaultIncludeFor(java.lang.String webElement)
          some columns with certain names should be by default discarded such as timestamp, optimistic, id and so on ...
 java.lang.String getDefaultRules()
           
 java.lang.String getDefaultValue()
           
 java.lang.String getDefaultWidget()
           
 Column getForeignColumn()
           
 java.lang.String getForeignKeyGetMethod(java.lang.String col)
           
 java.lang.String getForeignKeyInitializedMethod()
           
 java.lang.String getForeignKeyInitializedVarName()
           
 java.lang.String getForeignKeyModifiedMethod(java.lang.String col)
           
 java.lang.String getForeignKeyModifiedVarName()
           
 java.util.List getForeignKeys()
           
 java.lang.String getForeignKeySetMethod(java.lang.String col)
           
 java.lang.String getForeignKeyVarName()
           
 java.lang.String getFullName()
           
 java.lang.String getGetMethod()
           
 java.lang.String getImportedKeyAddMethod()
           
 java.lang.String getImportedKeyGetMethod()
           
 java.lang.String getImportedKeyInitializedMethod()
           
 java.lang.String getImportedKeyInitializedVarName()
           
 java.lang.String getImportedKeyModifiedMethod()
           
 java.lang.String getImportedKeyModifiedVarName()
           
 java.util.List getImportedKeys()
           
 java.lang.String getImportedKeySetMethod()
           
 java.lang.String getImportedKeyVarName()
           
 java.lang.String getInitializedMethod()
           
 java.lang.String getInitializedVarName()
           
 java.lang.String getJavaName()
           
 java.lang.String getJavaPrimaryType()
          return the primary java type of the current column return null if no java primary type is available
 java.lang.String getJavaType()
          return the java type of the current column
 java.lang.String getJavaTypeAsTypeName()
          return the string representation of the column type
 int getMappedType()
          return internal type for the current column
 java.lang.String getModifiedMethod()
           
 java.lang.String getModifiedVarName()
           
 java.lang.String getName()
           
 int getNullable()
           
 java.lang.String getNullableAsString()
           
 int getOrdinalPosition()
           
 java.lang.String getPreparedStatementMethod(java.lang.String var, int pos)
          Maps the SQL type for the column to a "set" method to call on the PreparedStatement.
 java.lang.String getPreparedStatementMethod(java.lang.String var, java.lang.String pos)
           
 java.lang.String getPropertyTag()
           
 java.lang.String getQuerySetMethod()
           
 int getRadix()
           
 java.lang.String getRemarks()
           
 java.lang.String getResultSetMethodObject(java.lang.String pos)
          return the resultSet get method for a given position the assumption is that the resultset variable is called rs
 java.lang.String getResultSetMethodObject(java.lang.String resultSet, java.lang.String pos)
           
 java.lang.String getSampleData()
           
 java.lang.String getSchema()
           
 java.lang.String getSetMethod()
           
 int getSize()
           
 java.lang.String getStringConvertionMethod()
          method to convert the given string into the internal java representation
 Table getTable()
           
 java.lang.String getTableName()
           
 short getType()
           
 java.lang.String getVarName()
           
 java.lang.String getWidgetMethod()
           
 boolean hasCompareTo()
          does this type has a compareTo method ?
 boolean hasPrimaryType()
          does this column has a primary java type like short, boolean instead of Integer and Boolean ?
 boolean isCalendar()
           
 boolean isColumnNumeric()
          is this column numeric ?
 boolean isDate()
           
 boolean isForeignKey()
           
 boolean isImportedKey()
           
 boolean isPrimaryKey()
           
 void isPrimaryKey(boolean isKey)
           
 boolean isString()
          is this column a string ?
 boolean isVersion()
           
 void setCatalog(java.lang.String catalog)
           
 void setCheckingType(java.lang.String strValue)
           
 void setDatabase(Database db)
           
 void setDecimalDigits(int decDigits)
           
 void setDefaultValue(java.lang.String defaultValue)
           
 void setName(java.lang.String name)
           
 void setNullable(int nullable)
           
 void setOrdinalPosition(int ordinal)
           
 void setRadix(int radix)
           
 void setRemarks(java.lang.String remarks)
           
 void setSchema(java.lang.String schema)
           
 void setSize(int size)
           
 void setTableName(java.lang.String tableName)
           
 void setType(short type)
           
 java.lang.String toString()
           
 boolean useEqualsInSetter()
          does this type can use equal instead of the compareTo method ?
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

M_ARRAY

public static final int M_ARRAY
See Also:
Constant Field Values

M_BIGDECIMAL

public static final int M_BIGDECIMAL
See Also:
Constant Field Values

M_BOOLEAN

public static final int M_BOOLEAN
See Also:
Constant Field Values

M_BYTES

public static final int M_BYTES
See Also:
Constant Field Values

M_CLOB

public static final int M_CLOB
See Also:
Constant Field Values

M_SQLDATE

public static final int M_SQLDATE
See Also:
Constant Field Values

M_UTILDATE

public static final int M_UTILDATE
See Also:
Constant Field Values

M_DOUBLE

public static final int M_DOUBLE
See Also:
Constant Field Values

M_FLOAT

public static final int M_FLOAT
See Also:
Constant Field Values

M_BLOB

public static final int M_BLOB
See Also:
Constant Field Values

M_INTEGER

public static final int M_INTEGER
See Also:
Constant Field Values

M_LONG

public static final int M_LONG
See Also:
Constant Field Values

M_REF

public static final int M_REF
See Also:
Constant Field Values

M_STRING

public static final int M_STRING
See Also:
Constant Field Values

M_TIME

public static final int M_TIME
See Also:
Constant Field Values

M_TIMESTAMP

public static final int M_TIMESTAMP
See Also:
Constant Field Values

M_URL

public static final int M_URL
See Also:
Constant Field Values

M_OBJECT

public static final int M_OBJECT
See Also:
Constant Field Values

M_CALENDAR

public static final int M_CALENDAR
See Also:
Constant Field Values
Constructor Detail

Column

public Column()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setCheckingType

public void setCheckingType(java.lang.String strValue)

getCheckingType

public java.lang.String getCheckingType()

setDatabase

public void setDatabase(Database db)

setCatalog

public void setCatalog(java.lang.String catalog)

setSchema

public void setSchema(java.lang.String schema)

setTableName

public void setTableName(java.lang.String tableName)

setName

public void setName(java.lang.String name)

setType

public void setType(short type)

setSize

public void setSize(int size)

setDecimalDigits

public void setDecimalDigits(int decDigits)

setRadix

public void setRadix(int radix)

setNullable

public void setNullable(int nullable)

setRemarks

public void setRemarks(java.lang.String remarks)

setDefaultValue

public void setDefaultValue(java.lang.String defaultValue)

setOrdinalPosition

public void setOrdinalPosition(int ordinal)

isPrimaryKey

public void isPrimaryKey(boolean isKey)

getCatalog

public java.lang.String getCatalog()

getSchema

public java.lang.String getSchema()

getTableName

public java.lang.String getTableName()

getName

public java.lang.String getName()

getType

public short getType()

getSize

public int getSize()

getDecimalDigits

public int getDecimalDigits()

getRadix

public int getRadix()

getNullable

public int getNullable()

getNullableAsString

public java.lang.String getNullableAsString()

getOrdinalPosition

public int getOrdinalPosition()

isPrimaryKey

public boolean isPrimaryKey()

getFullName

public java.lang.String getFullName()

getConstName

public java.lang.String getConstName()

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

getMappedType

public int getMappedType()
return internal type for the current column


getQuerySetMethod

public java.lang.String getQuerySetMethod()

getJavaType

public java.lang.String getJavaType()
return the java type of the current column


hasPrimaryType

public boolean hasPrimaryType()
does this column has a primary java type like short, boolean instead of Integer and Boolean ?


getJavaPrimaryType

public java.lang.String getJavaPrimaryType()
                                    throws java.lang.IllegalArgumentException
return the primary java type of the current column return null if no java primary type is available

Throws:
java.lang.IllegalArgumentException

getJavaTypeAsTypeName

public java.lang.String getJavaTypeAsTypeName()
return the string representation of the column type


isColumnNumeric

public boolean isColumnNumeric()
is this column numeric ?


isString

public boolean isString()
is this column a string ?


isDate

public boolean isDate()

isCalendar

public boolean isCalendar()

hasCompareTo

public boolean hasCompareTo()
                     throws java.lang.Exception
does this type has a compareTo method ?

Throws:
java.lang.Exception

useEqualsInSetter

public boolean useEqualsInSetter()
                          throws java.lang.Exception
does this type can use equal instead of the compareTo method ?

Throws:
java.lang.Exception

getResultSetMethodObject

public java.lang.String getResultSetMethodObject(java.lang.String pos)
return the resultSet get method for a given position the assumption is that the resultset variable is called rs


getResultSetMethodObject

public java.lang.String getResultSetMethodObject(java.lang.String resultSet,
                                                 java.lang.String pos)

getPreparedStatementMethod

public java.lang.String getPreparedStatementMethod(java.lang.String var,
                                                   int pos)
Maps the SQL type for the column to a "set" method to call on the PreparedStatement.
This is used when generating Manager classes. There are some variations in how different databases may deal with this, so you might look at the OracleManagerWriter to see how you might have to override this method for your particular database.

Parameters:
var - Java code that represents how we'll get access to the value to set. You should be able to use this value verbatim. Check out the source to this method to see what we mean.
pos - The position to pass as the first argument of the set method. You will be able to use this verbatim too.
Returns:
The string to write into the generated Manager .java file.

getPreparedStatementMethod

public java.lang.String getPreparedStatementMethod(java.lang.String var,
                                                   java.lang.String pos)

getStringConvertionMethod

public java.lang.String getStringConvertionMethod()
method to convert the given string into the internal java representation


getDefaultWidget

public java.lang.String getDefaultWidget()

isVersion

public boolean isVersion()

getTable

public Table getTable()

addForeignKey

public void addForeignKey(Column col)

getForeignKeys

public java.util.List getForeignKeys()

addImportedKey

public void addImportedKey(Column col)

getImportedKeys

public java.util.List getImportedKeys()

countImportedKeys

public int countImportedKeys()

isImportedKey

public boolean isImportedKey()

getForeignColumn

public Column getForeignColumn()

countForeignKeys

public int countForeignKeys()

isForeignKey

public boolean isForeignKey()

getPropertyTag

public java.lang.String getPropertyTag()

getDefaultRules

public java.lang.String getDefaultRules()

columnFor

public boolean columnFor(java.lang.String webElement)
is this column described to be in the given type ? check in sql2java.properties the table.[TABLENAME].in.[TYPE].exclude & table.[TABLENAME].in.[TYPE].include


getDefaultIncludeFor

public boolean getDefaultIncludeFor(java.lang.String webElement)
some columns with certain names should be by default discarded such as timestamp, optimistic, id and so on ...


getDefaultValue

public java.lang.String getDefaultValue()

getRemarks

public java.lang.String getRemarks()

getJavaName

public java.lang.String getJavaName()

getSampleData

public java.lang.String getSampleData()

convertName

public java.lang.String convertName(java.lang.String columnName)

convertName

public java.lang.String convertName(Column col)

convertName

public java.lang.String convertName()

getImportedKeyVarName

public java.lang.String getImportedKeyVarName()

getGetMethod

public java.lang.String getGetMethod()

getSetMethod

public java.lang.String getSetMethod()

getModifiedMethod

public java.lang.String getModifiedMethod()

getInitializedMethod

public java.lang.String getInitializedMethod()

getWidgetMethod

public java.lang.String getWidgetMethod()

getVarName

public java.lang.String getVarName()

getModifiedVarName

public java.lang.String getModifiedVarName()

getInitializedVarName

public java.lang.String getInitializedVarName()

getImportedKeyModifiedVarName

public java.lang.String getImportedKeyModifiedVarName()

getImportedKeyInitializedVarName

public java.lang.String getImportedKeyInitializedVarName()

getImportedKeyInitializedMethod

public java.lang.String getImportedKeyInitializedMethod()

getImportedKeyGetMethod

public java.lang.String getImportedKeyGetMethod()

getImportedKeyAddMethod

public java.lang.String getImportedKeyAddMethod()

getImportedKeySetMethod

public java.lang.String getImportedKeySetMethod()

getImportedKeyModifiedMethod

public java.lang.String getImportedKeyModifiedMethod()

getForeignKeyVarName

public java.lang.String getForeignKeyVarName()

getForeignKeyModifiedVarName

public java.lang.String getForeignKeyModifiedVarName()

getForeignKeyInitializedVarName

public java.lang.String getForeignKeyInitializedVarName()

getForeignKeyInitializedMethod

public java.lang.String getForeignKeyInitializedMethod()

getForeignKeyGetMethod

public java.lang.String getForeignKeyGetMethod(java.lang.String col)

getForeignKeySetMethod

public java.lang.String getForeignKeySetMethod(java.lang.String col)

getForeignKeyModifiedMethod

public java.lang.String getForeignKeyModifiedMethod(java.lang.String col)


Copyright © 2002-2007 . All Rights Reserved.