org.ujac.util.db
Class AttributeDefinition

java.lang.Object
  extended by org.ujac.util.db.AttributeDefinition

public class AttributeDefinition
extends Object

Name: AttributeDefinition
Description: A class holding the definition of a class attribute.

Author:
lauerc

Constructor Summary
AttributeDefinition(String name, String type)
          Constructs an AttributeDefinition instance with specific attributes.
AttributeDefinition(String name, String columnName, int sqlType, int columnSize, int decimalDigits, boolean primaryKey, boolean foreignKey, DataTypeMapper dataTypeMapper)
          Constructs an AttributeDefinition instance with specific attributes.
 
Method Summary
 String getColumnName()
          Gets the attribute's column name.
 String getFullyQualifiedType()
          Getter method for the the property fullyQualifiedType.
 String getGetter()
          Gets the name of the getter method for the attribute.
 String getName()
          Gets the current attribute name.
 String getPrimitiveType()
          Getter method for the the property primitiveType.
 String getSetter()
          Gets the name of the setter method for the attribute.
 int getSqlType()
          Gets the attribute's SQL type.
 String getSqlTypeName()
          Gets the attribute's SQL type name.
static String getSqlTypeName(int sqlType)
          Gets the name of the given SQL type
 String getType()
          Gets the current attribute type.
 boolean isForeignKey()
          Is the attribute a foreign key?
 boolean isPrimaryKey()
          Is the attribute a primary key?
 void setFullyQualifiedType(String fullyQualifiedType)
          Setter method for the the property fullyQualifiedType.
 void setPrimitiveType(String primitiveType)
          Setter method for the the property primitiveType.
 void setType(String type)
          Sets the attribute name type.
 String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeDefinition

public AttributeDefinition(String name,
                           String type)
Constructs an AttributeDefinition instance with specific attributes.

Parameters:
name - The attribute name.
type - The attribute type.

AttributeDefinition

public AttributeDefinition(String name,
                           String columnName,
                           int sqlType,
                           int columnSize,
                           int decimalDigits,
                           boolean primaryKey,
                           boolean foreignKey,
                           DataTypeMapper dataTypeMapper)
Constructs an AttributeDefinition instance with specific attributes.

Parameters:
name - The attribute name.
columnName - The column name.
sqlType - The sql type.
columnSize - The size of the SQL type.
decimalDigits - The number of decimal digits.
primaryKey - The primary key flag.
foreignKey - The foreign key flag.
dataTypeMapper - The data type mapper.
Method Detail

getName

public String getName()
Gets the current attribute name.

Returns:
The attribute name.

getType

public String getType()
Gets the current attribute type.

Returns:
The attribute type.

setType

public void setType(String type)
Sets the attribute name type.

Parameters:
type - The new attribute type.

getFullyQualifiedType

public String getFullyQualifiedType()
Getter method for the the property fullyQualifiedType.

Returns:
The current value of property fullyQualifiedType.

setFullyQualifiedType

public void setFullyQualifiedType(String fullyQualifiedType)
Setter method for the the property fullyQualifiedType.

Parameters:
fullyQualifiedType - The value to set for the property fullyQualifiedType.

getPrimitiveType

public String getPrimitiveType()
Getter method for the the property primitiveType.

Returns:
The current value of property primitiveType.

setPrimitiveType

public void setPrimitiveType(String primitiveType)
Setter method for the the property primitiveType.

Parameters:
primitiveType - The value to set for the property primitiveType.

getGetter

public String getGetter()
Gets the name of the getter method for the attribute.

Returns:
The getter method's name.

getSetter

public String getSetter()
Gets the name of the setter method for the attribute.

Returns:
The setter method's name.

getColumnName

public String getColumnName()
Gets the attribute's column name.

Returns:
The column name.

getSqlType

public int getSqlType()
Gets the attribute's SQL type.

Returns:
The SQL type.

getSqlTypeName

public String getSqlTypeName()
Gets the attribute's SQL type name.

Returns:
The SQL type name.

isPrimaryKey

public boolean isPrimaryKey()
Is the attribute a primary key?

Returns:
The primary key flag.

isForeignKey

public boolean isForeignKey()
Is the attribute a foreign key?

Returns:
The foreign key flag.

getSqlTypeName

public static final String getSqlTypeName(int sqlType)
Gets the name of the given SQL type

Parameters:
sqlType - The SQL type ID from java.sql.Types.
Returns:
The SQL type name.

toString

public String toString()
Returns a string representation of the object.

Overrides:
toString in class Object
Returns:
a string representation of the object.


Copyright © 2003-2004 UJAC.org. All Rights Reserved.