butler.sql.metadata
Class Column

java.lang.Object
  extended by butler.sql.metadata.Column
Direct Known Subclasses:
AggregateColumn, AliasColumn, FunctionColumn, InsertTimestampColumn, SequenceColumn, TimestampColumn, TransColumn, VirtualColumn

public class Column
extends java.lang.Object

Table column.

Author:
Fredrik Bertilsson

Constructor Summary
Column(java.lang.String name, Datatype datatype)
           
Column(java.lang.String name, int type, int size, int decimalDigits)
           
 
Method Summary
 Column copy()
           
static Datatype createDatatype(int type, int size, int decimalDigits)
           
 EqualsFilter eq(java.lang.Object value)
           
 boolean equals(Column other)
           
 boolean equals(java.lang.Object another)
           
 SimpleFilter ge(java.lang.Object value)
           
 java.lang.Object get(Record rec)
           
 java.lang.String getCaption()
          Caption to use in UI for this column.
static Column getColumn(java.util.Map tableDictonary, org.dom4j.Element element)
           
 int getColumnSize()
          Returns the size of the column.
 java.lang.String getCreateSQL()
           
 Datatype getDatatype()
           
 int getDecimalDigits()
          Returns the number of decimal digits for this column.
 java.lang.Object getDefaultValue()
           
 java.lang.String getHelp()
           
 butler.util.LocalizedText getLocalizableCaption()
           
 java.lang.String getName()
          Name of the column.
 java.lang.String getSQL()
           
 java.lang.String getSQL(java.lang.String tableAlias)
           
 java.lang.String getSQL(java.lang.String tableAlias, java.lang.String columnAlias)
           
 Table getTable()
           
 java.lang.String getTableName()
          Name of the table to which this column belongs.
 int getType()
          Type of the column (java.sql.Types).
 SimpleFilter gt(java.lang.Object value)
           
 int hashCode()
           
 boolean isEditable()
           
 boolean isInPrimaryKey()
          Returning if this column is in the primary key or not.
 boolean isNullable()
          Returns if the column is nullable or not.
 boolean isPhysical()
           
 SimpleFilter le(java.lang.Object value)
           
 LikeFilter like(java.lang.Object value)
           
 SimpleFilter lt(java.lang.Object value)
           
 SimpleFilter ne(java.lang.Object value)
           
 void set(Record rec, java.lang.Object value)
           
 void setCaption(java.lang.String caption)
           
 void setDatatype(Datatype datatype)
           
 void setDefaultValue(java.lang.Object value)
           
 void setEditable(boolean flag)
           
 void setInPrimaryKey(boolean flag)
           
 void setNullable(boolean flag)
           
 void setTable(Table table)
           
 java.lang.String toString()
           
 void toXML(org.xml.sax.ContentHandler handler)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Column

public Column(java.lang.String name,
              Datatype datatype)
       throws java.lang.Exception
Throws:
java.lang.Exception

Column

public Column(java.lang.String name,
              int type,
              int size,
              int decimalDigits)
       throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

copy

public Column copy()
            throws java.lang.Exception
Throws:
java.lang.Exception

getTableName

public java.lang.String getTableName()
Name of the table to which this column belongs.


setTable

public void setTable(Table table)
              throws java.lang.Exception
Throws:
java.lang.Exception

getTable

public Table getTable()

getName

public java.lang.String getName()
Name of the column.


getCaption

public java.lang.String getCaption()
                            throws java.lang.Exception
Caption to use in UI for this column.

Throws:
java.lang.Exception

getLocalizableCaption

public butler.util.LocalizedText getLocalizableCaption()
                                                throws java.lang.Exception
Throws:
java.lang.Exception

setCaption

public void setCaption(java.lang.String caption)

getType

public int getType()
            throws java.lang.Exception
Type of the column (java.sql.Types).

Throws:
java.lang.Exception

getColumnSize

public int getColumnSize()
                  throws java.lang.Exception
Returns the size of the column.

Throws:
java.lang.Exception

getDecimalDigits

public int getDecimalDigits()
                     throws java.lang.Exception
Returns the number of decimal digits for this column.

Throws:
java.lang.Exception

isInPrimaryKey

public boolean isInPrimaryKey()
Returning if this column is in the primary key or not.


setInPrimaryKey

public void setInPrimaryKey(boolean flag)

isNullable

public boolean isNullable()
Returns if the column is nullable or not.


setNullable

public void setNullable(boolean flag)

setDatatype

public void setDatatype(Datatype datatype)

getDatatype

public Datatype getDatatype()
                     throws java.lang.Exception
Throws:
java.lang.Exception

isPhysical

public boolean isPhysical()

getSQL

public java.lang.String getSQL()
                        throws java.lang.Exception
Throws:
java.lang.Exception

getSQL

public java.lang.String getSQL(java.lang.String tableAlias)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getSQL

public java.lang.String getSQL(java.lang.String tableAlias,
                               java.lang.String columnAlias)
                        throws java.lang.Exception
Throws:
java.lang.Exception

toString

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

equals

public boolean equals(Column other)

equals

public boolean equals(java.lang.Object another)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toXML

public void toXML(org.xml.sax.ContentHandler handler)
           throws java.lang.Exception
Throws:
java.lang.Exception

getColumn

public static Column getColumn(java.util.Map tableDictonary,
                               org.dom4j.Element element)
                        throws java.lang.Exception
Throws:
java.lang.Exception

createDatatype

public static Datatype createDatatype(int type,
                                      int size,
                                      int decimalDigits)
                               throws java.lang.Exception
Throws:
java.lang.Exception

setDefaultValue

public void setDefaultValue(java.lang.Object value)

getDefaultValue

public java.lang.Object getDefaultValue()

isEditable

public boolean isEditable()

setEditable

public void setEditable(boolean flag)

get

public java.lang.Object get(Record rec)
                     throws java.lang.Exception
Throws:
java.lang.Exception

set

public void set(Record rec,
                java.lang.Object value)
         throws java.lang.Exception
Throws:
java.lang.Exception

eq

public EqualsFilter eq(java.lang.Object value)
                throws java.lang.Exception
Throws:
java.lang.Exception

like

public LikeFilter like(java.lang.Object value)
                throws java.lang.Exception
Throws:
java.lang.Exception

lt

public SimpleFilter lt(java.lang.Object value)
                throws java.lang.Exception
Throws:
java.lang.Exception

le

public SimpleFilter le(java.lang.Object value)
                throws java.lang.Exception
Throws:
java.lang.Exception

gt

public SimpleFilter gt(java.lang.Object value)
                throws java.lang.Exception
Throws:
java.lang.Exception

ge

public SimpleFilter ge(java.lang.Object value)
                throws java.lang.Exception
Throws:
java.lang.Exception

ne

public SimpleFilter ne(java.lang.Object value)
                throws java.lang.Exception
Throws:
java.lang.Exception

getHelp

public java.lang.String getHelp()
                         throws java.lang.Exception
Throws:
java.lang.Exception

getCreateSQL

public java.lang.String getCreateSQL()
                              throws java.lang.Exception
Throws:
java.lang.Exception