org.apache.torque.engine.database.model
Class Domain

java.lang.Object
  extended by org.apache.torque.engine.database.model.Domain
Direct Known Subclasses:
SizedForBitDataDomain

public class Domain
extends Object

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

Version:
$Id: Domain.java,v 1.1 2007-10-21 07:57:27 abyrne Exp $
Author:
Constructor Summary
Domain()
          Creates a new instance with a null name.
Domain(Domain domain)
           
Domain(SchemaType type)
          Creates a new Domain and set the name
Domain(SchemaType type, String sqlType)
          Creates a new Domain and set the name
Domain(SchemaType type, String sqlType, String size)
          Creates a new Domain and set the name
Domain(SchemaType type, String sqlType, String size, String scale)
          Creates a new Domain and set the name
Domain(String name)
          Creates a new Domain and set the name
 
Method Summary
 void copy(Domain domain)
           
 String getDefaultSetting()
          Deprecated.  
 String getDefaultValue()
           
 String getDescription()
           
 String getName()
           
 String getScale()
           
 String getSize()
           
 String getSqlType()
           
 SchemaType getType()
           
 void loadFromXML(Attributes attrib, Platform platform)
          Imports a column from an XML specification
 String printSize()
          Return the size and scale in brackets for use in an sql schema.
 void replaceDefaultValue(String value)
          Replaces the default value if the new value is not null.
 void replaceScale(String value)
          Replaces the size if the new value is not null.
 void replaceSize(String value)
          Replaces the size if the new value is not null.
 void replaceType(String value)
          Replaces the default value if the new value is not null.
 void setDefaultValue(String defaultValue)
           
 void setDescription(String description)
           
 void setName(String name)
           
 void setScale(String scale)
           
 void setSize(String size)
           
 void setSqlType(String sqlType)
           
 void setType(SchemaType torqueType)
           
 void setType(String torqueType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Domain

public Domain()
Creates a new instance with a null name.


Domain

public Domain(String name)
Creates a new Domain and set the name

Parameters:
name - column name

Domain

public Domain(SchemaType type)
Creates a new Domain and set the name


Domain

public Domain(SchemaType type,
              String sqlType)
Creates a new Domain and set the name


Domain

public Domain(SchemaType type,
              String sqlType,
              String size,
              String scale)
Creates a new Domain and set the name


Domain

public Domain(SchemaType type,
              String sqlType,
              String size)
Creates a new Domain and set the name


Domain

public Domain(Domain domain)
Method Detail

copy

public void copy(Domain domain)

loadFromXML

public void loadFromXML(Attributes attrib,
                        Platform platform)
Imports a column from an XML specification


getDescription

public String getDescription()
Returns:
Returns the description.

setDescription

public void setDescription(String description)
Parameters:
description - The description to set.

getName

public String getName()
Returns:
Returns the name.

setName

public void setName(String name)
Parameters:
name - The name to set.

getScale

public String getScale()
Returns:
Returns the scale.

setScale

public void setScale(String scale)
Parameters:
scale - The scale to set.

replaceScale

public void replaceScale(String value)
Replaces the size if the new value is not null.

Parameters:
value - The size to set.

getSize

public String getSize()
Returns:
Returns the size.

setSize

public void setSize(String size)
Parameters:
size - The size to set.

replaceSize

public void replaceSize(String value)
Replaces the size if the new value is not null.

Parameters:
value - The size to set.

getType

public SchemaType getType()
Returns:
Returns the torqueType.

setType

public void setType(SchemaType torqueType)
Parameters:
torqueType - The torqueType to set.

setType

public void setType(String torqueType)
Parameters:
torqueType - The torqueType to set.

replaceType

public void replaceType(String value)
Replaces the default value if the new value is not null.

Parameters:
value - The defaultValue to set.

getDefaultValue

public String getDefaultValue()
Returns:
Returns the defaultValue.

getDefaultSetting

public String getDefaultSetting()
Deprecated. 

Return a string that will give this column a default value.


setDefaultValue

public void setDefaultValue(String defaultValue)
Parameters:
defaultValue - The defaultValue to set.

replaceDefaultValue

public void replaceDefaultValue(String value)
Replaces the default value if the new value is not null.

Parameters:
value - The defaultValue to set.

getSqlType

public String getSqlType()
Returns:
Returns the sqlType.

setSqlType

public void setSqlType(String sqlType)
Parameters:
sqlType - The sqlType to set.

printSize

public String printSize()
Return the size and scale in brackets for use in an sql schema.

Returns:
size and scale or an empty String if there are no values available.


Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.