org.apache.turbine.torque.engine.database.model
Class Column

java.lang.Object
  |
  +--org.apache.turbine.torque.engine.database.model.Column

Deprecated. use turbine-torque

public class Column
extends java.lang.Object

A Class for holding data about a column used in an Application.

Version:
$Id: Column.java,v 1.4 2002/02/26 22:15:43 fedor Exp $
Author:
Leon Messerschmidt, Jason van Zyl, Jon S. Stevens, Daniel Rall

Field Summary
private  java.lang.Object columnType
          Deprecated.  
private  java.lang.String defaultValue
          Deprecated.  
private  java.util.List inheritanceList
          Deprecated.  
private  java.lang.String inheritanceType
          Deprecated.  
private  java.lang.String inputValidator
          Deprecated.  
private  boolean isAutoIncrement
          Deprecated.  
private  boolean isEnumeratedClasses
          Deprecated.  
private  boolean isInheritance
          Deprecated.  
private  boolean isNotNull
          Deprecated.  
private  boolean isPrimaryKey
          Deprecated.  
private  boolean isUnique
          Deprecated.  
private  java.lang.String javaName
          Deprecated.  
private  java.lang.String name
          Deprecated.  
private  Table parentTable
          Deprecated.  
private  int position
          Deprecated.  
private  java.util.List referrers
          Deprecated.  
private  java.lang.String size
          Deprecated.  
private  java.lang.String torqueType
          Deprecated.  
 
Constructor Summary
Column()
          Deprecated. Default Constructor
Column(java.lang.String name)
          Deprecated. Creates a new column and set the name
 
Method Summary
 Inheritance addInheritance(org.xml.sax.AttributeList attrib)
          Deprecated. A utility function to create a new column from attrib and add it to this table.
 void addInheritance(Inheritance inh)
          Deprecated. Adds a new inheritance definition to the inheritance vector and set the parent column of the inheritance to the current column
 void addReferrer(ForeignKey fk)
          Deprecated. Adds the foreign key from another table that refers to this column.
 java.util.List getChildren()
          Deprecated. Get the inheritance definitions.
 java.lang.String getDefaultSetting()
          Deprecated. Return a string that will give this column a default value.
 java.lang.String getDefaultValue()
          Deprecated. Get a string that will give this column a default value.
 ForeignKey getForeignKey()
          Deprecated. get the foreign key object for this column if it is a foreign key or part of a foreign key
 java.lang.String getFullyQualifiedName()
          Deprecated. Returns table.column
 java.lang.String getInputValidator()
          Deprecated. Returns the class name to do input validation
 java.lang.String getJavaName()
          Deprecated. Get name to use in Java sources
 java.lang.String getJavaNative()
          Deprecated. Return a string representation of the native java type which corresponds to the JDBC type of this column.
 java.lang.String getJavaObject()
          Deprecated. Return a string representation of the Java object which corresponds to the JDBC type of this column.
 java.lang.String getName()
          Deprecated. Get the name of the column
 java.lang.String getParameterParserMethod()
          Deprecated. Return ParameterParser getX() method which corresponds to the JDBC type which represents this column.
 int getPosition()
          Deprecated. Get the location of this column within the table (one-based).
 java.util.List getReferrers()
          Deprecated. Get list of references to this column.
 java.lang.String getRelatedColumnName()
          Deprecated. Utility method to get the related column of this local column if this column is a foreign key or part of a foreign key.
 java.lang.String getRelatedTableName()
          Deprecated. Utility method to get the related table of this column if it is a foreign key or part of a foreign key
 java.lang.String getSize()
          Deprecated. Returns the size of the column
 Table getTable()
          Deprecated. Get the parent Table of the column
 java.lang.String getTableName()
          Deprecated. Returns the Name of the table the column is in
 java.lang.Object getTorqueType()
          Deprecated. Returns the column type as given in the schema as an object
 java.lang.Object getType()
          Deprecated. Returns the column jdbc type as an object
 java.lang.String getVillageMethod()
          Deprecated. Return Village asX() method which corresponds to the JDBC type which represents this column.
 boolean isAutoIncrement()
          Deprecated. Return auto increment/sequence string for the target database.
 boolean isBooleanChar()
          Deprecated. Returns true if the column type is boolean in the java object and a String ("Y" or "N") in the db.
 boolean isBooleanInt()
          Deprecated. Returns true if the column type is boolean in the java object and a numeric (1 or 0) in the db.
 boolean isEnumeratedClasses()
          Deprecated. Determine if possible classes have been enumerated in the xml file.
 boolean isForeignKey()
          Deprecated. Utility method to determine if this column is a foreign key.
 boolean isInheritance()
          Deprecated. Determine if this column is a normal property or specifies a the classes that are represented in the table containing this column.
 boolean isMultipleFK()
          Deprecated. Determine if this column is a foreign key that refers to the same table as another foreign key column in this table.
 boolean isNotNull()
          Deprecated. Return the isNotNull property of the column
 boolean isPrimaryKey()
          Deprecated. Return true if the column is a primary key
 boolean isPrimitive()
          Deprecated. returns true, if the columns java native type is an boolean, byte, short, int, long, float, double, char
 boolean isString()
          Deprecated. Utility method to see if the column is a string
 boolean isUnique()
          Deprecated. Get the UNIQUE property
 void loadFromXML(org.xml.sax.AttributeList attrib)
          Deprecated. Imports a column from an XML specification
 java.lang.String printSize()
          Deprecated. Return the size in brackets for use in an sql schema if the type is String.
 void setAutoIncrement(boolean value)
          Deprecated. Set the auto increment value Use isAutoIncrement() to find out if it is set or not.
 void setDefaultValue(java.lang.String def)
          Deprecated. Set a string that will give this column a default value.
 void setJavaName(java.lang.String javaName)
          Deprecated. Set name to use in Java sources
 void setName(java.lang.String newName)
          Deprecated. Set the name of the column
 void setNotNull(boolean status)
          Deprecated. Set the isNotNull property of the column
 void setPosition(int v)
          Deprecated. Get the location of this column within the table (one-based).
 void setPrimaryKey(boolean pk)
          Deprecated. Set if the column is a primary key or not
 void setSize(java.lang.String newSize)
          Deprecated. Set the size of the column
 void setTable(Table parent)
          Deprecated. Set the parent Table of the column
 void setType(java.lang.String torqueType)
          Deprecated. Returns the colunm type
 void setTypeFromString(java.lang.String typeName, java.lang.String size)
          Deprecated. Set the column type from a string property (normally a string from an sql input file)
 void setUnique(boolean u)
          Deprecated. Set true if the column is UNIQUE
 java.lang.String toString()
          Deprecated. String representation of the column.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

name

private java.lang.String name
Deprecated. 

javaName

private java.lang.String javaName
Deprecated. 

isNotNull

private boolean isNotNull
Deprecated. 

size

private java.lang.String size
Deprecated. 

torqueType

private java.lang.String torqueType
Deprecated. 

columnType

private java.lang.Object columnType
Deprecated. 

parentTable

private Table parentTable
Deprecated. 

position

private int position
Deprecated. 

isPrimaryKey

private boolean isPrimaryKey
Deprecated. 

isUnique

private boolean isUnique
Deprecated. 

isAutoIncrement

private boolean isAutoIncrement
Deprecated. 

defaultValue

private java.lang.String defaultValue
Deprecated. 

referrers

private java.util.List referrers
Deprecated. 

inheritanceType

private java.lang.String inheritanceType
Deprecated. 

isInheritance

private boolean isInheritance
Deprecated. 

isEnumeratedClasses

private boolean isEnumeratedClasses
Deprecated. 

inheritanceList

private java.util.List inheritanceList
Deprecated. 

inputValidator

private java.lang.String inputValidator
Deprecated. 
Constructor Detail

Column

public Column()
Deprecated. 
Default Constructor

Column

public Column(java.lang.String name)
Deprecated. 
Creates a new column and set the name
Method Detail

loadFromXML

public void loadFromXML(org.xml.sax.AttributeList attrib)
Deprecated. 
Imports a column from an XML specification

getFullyQualifiedName

public java.lang.String getFullyQualifiedName()
Deprecated. 
Returns table.column

getName

public java.lang.String getName()
Deprecated. 
Get the name of the column

setName

public void setName(java.lang.String newName)
Deprecated. 
Set the name of the column

getJavaName

public java.lang.String getJavaName()
Deprecated. 
Get name to use in Java sources

setJavaName

public void setJavaName(java.lang.String javaName)
Deprecated. 
Set name to use in Java sources

getPosition

public int getPosition()
Deprecated. 
Get the location of this column within the table (one-based).
Returns:
value of position.

setPosition

public void setPosition(int v)
Deprecated. 
Get the location of this column within the table (one-based).
Parameters:
v - Value to assign to position.

setTable

public void setTable(Table parent)
Deprecated. 
Set the parent Table of the column

getTable

public Table getTable()
Deprecated. 
Get the parent Table of the column

getTableName

public java.lang.String getTableName()
Deprecated. 
Returns the Name of the table the column is in

addInheritance

public Inheritance addInheritance(org.xml.sax.AttributeList attrib)
Deprecated. 
A utility function to create a new column from attrib and add it to this table.

addInheritance

public void addInheritance(Inheritance inh)
Deprecated. 
Adds a new inheritance definition to the inheritance vector and set the parent column of the inheritance to the current column

getChildren

public java.util.List getChildren()
Deprecated. 
Get the inheritance definitions.

isInheritance

public boolean isInheritance()
Deprecated. 
Determine if this column is a normal property or specifies a the classes that are represented in the table containing this column.

isEnumeratedClasses

public boolean isEnumeratedClasses()
Deprecated. 
Determine if possible classes have been enumerated in the xml file.

isNotNull

public boolean isNotNull()
Deprecated. 
Return the isNotNull property of the column

setNotNull

public void setNotNull(boolean status)
Deprecated. 
Set the isNotNull property of the column

setPrimaryKey

public void setPrimaryKey(boolean pk)
Deprecated. 
Set if the column is a primary key or not

isPrimaryKey

public boolean isPrimaryKey()
Deprecated. 
Return true if the column is a primary key

setUnique

public void setUnique(boolean u)
Deprecated. 
Set true if the column is UNIQUE

isUnique

public boolean isUnique()
Deprecated. 
Get the UNIQUE property

isForeignKey

public boolean isForeignKey()
Deprecated. 
Utility method to determine if this column is a foreign key.

isMultipleFK

public boolean isMultipleFK()
Deprecated. 
Determine if this column is a foreign key that refers to the same table as another foreign key column in this table.

getForeignKey

public ForeignKey getForeignKey()
Deprecated. 
get the foreign key object for this column if it is a foreign key or part of a foreign key

getRelatedTableName

public java.lang.String getRelatedTableName()
Deprecated. 
Utility method to get the related table of this column if it is a foreign key or part of a foreign key

getRelatedColumnName

public java.lang.String getRelatedColumnName()
Deprecated. 
Utility method to get the related column of this local column if this column is a foreign key or part of a foreign key.

addReferrer

public void addReferrer(ForeignKey fk)
Deprecated. 
Adds the foreign key from another table that refers to this column.

getReferrers

public java.util.List getReferrers()
Deprecated. 
Get list of references to this column.

setType

public void setType(java.lang.String torqueType)
Deprecated. 
Returns the colunm type

getType

public java.lang.Object getType()
Deprecated. 
Returns the column jdbc type as an object

getTorqueType

public java.lang.Object getTorqueType()
Deprecated. 
Returns the column type as given in the schema as an object

isString

public boolean isString()
Deprecated. 
Utility method to see if the column is a string

toString

public java.lang.String toString()
Deprecated. 
String representation of the column. This is an xml representation.
Overrides:
toString in class java.lang.Object

getSize

public java.lang.String getSize()
Deprecated. 
Returns the size of the column

setSize

public void setSize(java.lang.String newSize)
Deprecated. 
Set the size of the column

printSize

public java.lang.String printSize()
Deprecated. 
Return the size in brackets for use in an sql schema if the type is String. Otherwise return an empty string

getDefaultSetting

public java.lang.String getDefaultSetting()
Deprecated. 
Return a string that will give this column a default value.

TODO: Properly SQL-escape text values.


setDefaultValue

public void setDefaultValue(java.lang.String def)
Deprecated. 
Set a string that will give this column a default value.

getDefaultValue

public java.lang.String getDefaultValue()
Deprecated. 
Get a string that will give this column a default value.

getInputValidator

public java.lang.String getInputValidator()
Deprecated. 
Returns the class name to do input validation

isAutoIncrement

public boolean isAutoIncrement()
Deprecated. 
Return auto increment/sequence string for the target database. We need to pass in the props for the target database!

setAutoIncrement

public void setAutoIncrement(boolean value)
Deprecated. 
Set the auto increment value Use isAutoIncrement() to find out if it is set or not.

setTypeFromString

public void setTypeFromString(java.lang.String typeName,
                              java.lang.String size)
Deprecated. 
Set the column type from a string property (normally a string from an sql input file)

getJavaObject

public java.lang.String getJavaObject()
Deprecated. 
Return a string representation of the Java object which corresponds to the JDBC type of this column. Use in the generation of MapBuilders.

getJavaNative

public java.lang.String getJavaNative()
Deprecated. 
Return a string representation of the native java type which corresponds to the JDBC type of this column. Use in the generation of Base objects.

getVillageMethod

public java.lang.String getVillageMethod()
Deprecated. 
Return Village asX() method which corresponds to the JDBC type which represents this column.

getParameterParserMethod

public java.lang.String getParameterParserMethod()
Deprecated. 
Return ParameterParser getX() method which corresponds to the JDBC type which represents this column.

isBooleanInt

public boolean isBooleanInt()
Deprecated. 
Returns true if the column type is boolean in the java object and a numeric (1 or 0) in the db.

isBooleanChar

public boolean isBooleanChar()
Deprecated. 
Returns true if the column type is boolean in the java object and a String ("Y" or "N") in the db.

isPrimitive

public boolean isPrimitive()
Deprecated. 
returns true, if the columns java native type is an boolean, byte, short, int, long, float, double, char


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.