net.sf.jso.sql
Class ColumnDescriptor

java.lang.Object
  extended bynet.sf.jso.sql.ColumnDescriptor
All Implemented Interfaces:
java.io.Serializable

public class ColumnDescriptor
extends java.lang.Object
implements java.io.Serializable

Class for column descritptors. Column descriptors represent columns of a table in a relational database.

See Also:
Serialized Form

Constructor Summary
ColumnDescriptor()
          Constructs the column descriptor.
ColumnDescriptor(java.lang.String aName, int aType)
          Constructs a nullable column descriptor.
ColumnDescriptor(java.lang.String aName, int aType, boolean isNullable)
          Constructs a column descriptor.
 
Method Summary
 boolean equals(java.lang.Object o)
          Indicates whether some other column descriptor is "equal to" this one.
 java.lang.String getName()
          Gets column's name.
 int getType()
          Gets column's type.
 int hashCode()
          Returns a hash code value for the column descriptor.
 boolean isNullable()
           
 void setName(java.lang.String aName)
          Sets column's name.
 void setNullable(boolean isNullable)
           
 void setType(int aType)
          Sets column's type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnDescriptor

public ColumnDescriptor()
Constructs the column descriptor.


ColumnDescriptor

public ColumnDescriptor(java.lang.String aName,
                        int aType)
                 throws java.lang.IllegalArgumentException
Constructs a nullable column descriptor.

Parameters:
aName - A name for the column.
aType - A type for the column.

ColumnDescriptor

public ColumnDescriptor(java.lang.String aName,
                        int aType,
                        boolean isNullable)
                 throws java.lang.IllegalArgumentException
Constructs a column descriptor.

Parameters:
aName - A name for the column.
aType - A type for the column.
isNullable - Indicates if the column is nullable.
Method Detail

setName

public void setName(java.lang.String aName)
Sets column's name.

Parameters:
aName - A name for the column.

getName

public java.lang.String getName()
Gets column's name.

Returns:
column's name.

setType

public void setType(int aType)
             throws java.lang.IllegalArgumentException
Sets column's type.

Parameters:
aType - A type for the column. Only the following SQL types are allowed:
  • BIGINT
  • BOOLEAN
  • CHAR
  • DATE
  • DOUBLE
  • FLOAT
  • INTEGER
  • LONGVARCHAR
  • NULL
  • SMALLINT
  • TIME
  • TIMESTAMP
  • TINYINT
  • VARCHAR
Throws:
java.lang.IllegalArgumentException

getType

public int getType()
Gets column's type.

Returns:
column's type.

setNullable

public void setNullable(boolean isNullable)

isNullable

public boolean isNullable()

equals

public boolean equals(java.lang.Object o)
Indicates whether some other column descriptor is "equal to" this one.

Parameters:
o - The object with which to compare.
Returns:
true if the column descriptor is the same as the column descriptor argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the column descriptor.

Returns:
A hash code value for the column descriptor.