pt.moredata.dao.core
Class PublicGenericMetaField

java.lang.Object
  extended bypt.moredata.dao.core.GenericMetaField
      extended bypt.moredata.dao.core.PublicGenericMetaField
All Implemented Interfaces:
MetaField
Direct Known Subclasses:
DataMetaField

Deprecated. This class will be removed in the future.

public class PublicGenericMetaField
extends pt.moredata.dao.core.GenericMetaField

Public GenericMetaField to be used by DataMetaField class. Company MoreData

Version:
$Revision: 1.3 $
Author:
pcarmo

Field Summary
protected  java.lang.String _tableAlias
          Table alias.
protected  java.lang.String _tableName
          Table Name.
static java.lang.String[] specialTypesNames
          Nomes dos tipos especiais.
 
Fields inherited from interface pt.moredata.dao.MetaField
NONE, SERIAL
 
Constructor Summary
PublicGenericMetaField(java.lang.String columnName)
          Deprecated. Cria uma novoa representação de uma coluna de uma tabela.
PublicGenericMetaField(java.lang.String tableName, java.lang.String columnName)
          Deprecated. Cria uma novoa representação de uma coluna de uma tabela.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Check if this metafield is equal to another one.
 java.lang.String getColumnName()
          Return the meta field column name.
 int getDAOIndex()
          Return the DAO index of the column represented by the meta field.
 int getDataType()
          Return the data type of the column represented by the meta field.
 DataType getDataTypeInfo()
          Deprecated. Use method getDataType() instead.
 java.lang.Object getDefaultValue()
          Return the default value of the column represented by the meta fields.
 java.lang.String getLabel()
          Return string with a label that identifies the column.
 int getLength()
          Return the length of the column represented by the meta field.
 int getQueryPolicy()
          Returns the policy used by DataAccessObject query method for this column.
 int getSpecialType()
          Return the special type of the column represented by this meta field or NONE if the column has no special type.
 java.lang.String getTableAlias()
          Getter for property tableAlias.
 java.lang.String getTableName()
          Return the table name of the column represented by the meta field.
 java.lang.String getTableNameOrAlias()
          Return the table alias or the table name if the alias is null.
 boolean isAcceptNull()
          Check if the column represented by the meta field accepts null as value.
 boolean isCounter()
          Check if the column is a counter type column.
 boolean isDefaultValueEngineProcessed()
          Indicate if the default value is engine processed or not.
 boolean isFK()
          Check if the column is a foreign key column.
 boolean isIncludeInQuery()
          Check if the field should be include in a database selected.
 boolean isPK()
          Check if the column is a primary key column.
 boolean isRepositoryField()
          Check if the field is a repository field.
 boolean isUpdateable()
          Check if the field could be update or not.
 void setAcceptNull(boolean acceptNull)
          Change the acceptNull property for the column represented by the meta field.
 void setCounter(boolean counter)
          Change the counter property of the column represented by the metafield.
 void setDAOIndex(int index)
          Change the DAO index of the column represented by this MetaField
 void setDataType(int dataType)
          Change the DataType object of the column represented by the meta field.
 void setDataTypeInfo(DataType dataType)
          Deprecated. Use method setDataType instead.
 void setDefaultValue(java.lang.Object value)
          Change the default value of the column represented by the meta field.
 void setDefaultValueEngineProcessed(boolean defaultValueEngineProcessed)
          Change the value of the defaultValueEngineProcessed property.
 void setFK(boolean isFk)
          Change the FK property of the metafield.
 void setIncludeInQuery(boolean includeInQuery)
          Change the includeInQuery property of the metafield.
 void setLabel(java.lang.String label)
          Change the label of the column represented by the meta field.
 void setLength(int length)
          Change the length of the column.
 void setPK(boolean isPk)
          Change the PK property of the metafield.
 void setQueryPolicy(int queryPolicy)
          Changes the query policy for this column.
 void setRepositoryField(boolean repositoryField)
          Setter for property repositoryField.
 void setSpecialType(int specialType)
          Change the specialType property of the column represented by the meta field.
 void setUpdateable(boolean updateable)
          Change the updateable property of the metafield.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

specialTypesNames

public static java.lang.String[] specialTypesNames
Nomes dos tipos especiais.


_tableName

protected java.lang.String _tableName
Table Name.


_tableAlias

protected java.lang.String _tableAlias
Table alias.

Constructor Detail

PublicGenericMetaField

public PublicGenericMetaField(java.lang.String tableName,
                              java.lang.String columnName)
                       throws java.lang.NullPointerException
Deprecated. 
Cria uma novoa representação de uma coluna de uma tabela.

Parameters:
tableName - Nome da tabela.
columnName - Nome da coluna.
Throws:
java.lang.NullPointerException - If the columnNAme is null.

PublicGenericMetaField

public PublicGenericMetaField(java.lang.String columnName)
                       throws java.lang.NullPointerException
Deprecated. 
Cria uma novoa representação de uma coluna de uma tabela.

Parameters:
columnName - Nome da coluna.
Throws:
java.lang.NullPointerException - If the columnNAme is null.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Check if this metafield is equal to another one. Two MetaField's are equal if they have the same columnName and the same tableName

Parameters:
obj - A MetaField object.
Returns:
True if The obj is a MetaField and if the columnName and tableName are the same as this object.

getColumnName

public java.lang.String getColumnName()
Return the meta field column name.

Specified by:
getColumnName in interface MetaField
Returns:
The meta field column name.

getDAOIndex

public int getDAOIndex()
Return the DAO index of the column represented by the meta field.

Specified by:
getDAOIndex in interface MetaField
Returns:
The DAO index of the column represented by the meta field.

getDataType

public int getDataType()
Return the data type of the column represented by the meta field.

Specified by:
getDataType in interface MetaField
Returns:
The data type of the column represented by the meta field.

getDataTypeInfo

public DataType getDataTypeInfo()
Deprecated. Use method getDataType() instead.

Return a DataType object with the information of the data type of the column represented by the meta field.

Specified by:
getDataTypeInfo in interface MetaField
Returns:
A DataType object with the information of the data type of the column represented by the meta field.

getDefaultValue

public java.lang.Object getDefaultValue()
Return the default value of the column represented by the meta fields.

Specified by:
getDefaultValue in interface MetaField
Returns:
The default value of the column represented by the meta fields.

getLabel

public java.lang.String getLabel()
Return string with a label that identifies the column.

Specified by:
getLabel in interface MetaField
Returns:
A string with a label that identifies the column.

getLength

public int getLength()
Return the length of the column represented by the meta field.

Specified by:
getLength in interface MetaField
Returns:
The length of the column represented by the meta field.

getQueryPolicy

public int getQueryPolicy()
Returns the policy used by DataAccessObject query method for this column.

Specified by:
getQueryPolicy in interface MetaField
Returns:
The policy used by DataAccessObject query method for this column.

getSpecialType

public int getSpecialType()
Return the special type of the column represented by this meta field or NONE if the column has no special type.

Specified by:
getSpecialType in interface MetaField
Returns:
The special type of the column represented by this meta field or NONE if the column has no special type.

getTableName

public java.lang.String getTableName()
Return the table name of the column represented by the meta field.

Specified by:
getTableName in interface MetaField
Returns:
The table name of the column represented by the meta field.

getTableNameOrAlias

public java.lang.String getTableNameOrAlias()
Return the table alias or the table name if the alias is null.

Specified by:
getTableNameOrAlias in interface MetaField
Returns:
The table alias of the column represented by the meta field or the table name if the alias is null.

getTableAlias

public java.lang.String getTableAlias()
Getter for property tableAlias.

Specified by:
getTableAlias in interface MetaField
Returns:
Value of property tableAlias.

isAcceptNull

public boolean isAcceptNull()
Check if the column represented by the meta field accepts null as value.

Specified by:
isAcceptNull in interface MetaField
Returns:
True if the column represented by the meta field accepts null as value false otherwise.

isCounter

public boolean isCounter()
Check if the column is a counter type column. Columns of counter type are automatic incremented by the repository and need to be read after a insert.

Specified by:
isCounter in interface MetaField
Returns:
True if the column is a counter column, false otherwise.

isFK

public boolean isFK()
Check if the column is a foreign key column.

Specified by:
isFK in interface MetaField
Returns:
True is the column is a foreign key column, false otherwise.

isPK

public boolean isPK()
Check if the column is a primary key column.

Specified by:
isPK in interface MetaField
Returns:
True is the column is a primary key column, false otherwise.

isUpdateable

public boolean isUpdateable()
Check if the field could be update or not.

Specified by:
isUpdateable in interface MetaField
Returns:
True if the field can be updated, false otherwise.

setAcceptNull

public void setAcceptNull(boolean acceptNull)
Change the acceptNull property for the column represented by the meta field.

Specified by:
setAcceptNull in interface MetaField
Parameters:
acceptNull - True if the column accepts null, false otherwise.

setCounter

public void setCounter(boolean counter)
                throws DAORuntimeException
Change the counter property of the column represented by the metafield.

Specified by:
setCounter in interface MetaField
Parameters:
counter - True if the column if of counter type, false otherwise.
Throws:
DAORuntimeException - se o campo for do tipo serial ou se o campo tiver um valor fixo.

setDAOIndex

public void setDAOIndex(int index)
Change the DAO index of the column represented by this MetaField

Specified by:
setDAOIndex in interface MetaField
Parameters:
index - The repository index of the column.

setDataType

public void setDataType(int dataType)
Change the DataType object of the column represented by the meta field.

Specified by:
setDataType in interface MetaField
Parameters:
dataType - The data type code value from java.sql.Types.

setDataTypeInfo

public void setDataTypeInfo(DataType dataType)
Deprecated. Use method setDataType instead.

Change the DataType object of the column represented by the meta field.

Specified by:
setDataTypeInfo in interface MetaField
Parameters:
dataType - The DataType object.

setDefaultValue

public void setDefaultValue(java.lang.Object value)
Change the default value of the column represented by the meta field.

Specified by:
setDefaultValue in interface MetaField
Parameters:
value - The new default value of the column.

setFK

public void setFK(boolean isFk)
Change the FK property of the metafield.

Specified by:
setFK in interface MetaField
Parameters:
isFk - True if the metafield represents a foreign key column, false otherwise.

setLabel

public void setLabel(java.lang.String label)
Change the label of the column represented by the meta field.

Specified by:
setLabel in interface MetaField
Parameters:
label - The new column label.

setLength

public void setLength(int length)
Change the length of the column.

Specified by:
setLength in interface MetaField
Parameters:
length - The new column length (characters number).

setPK

public void setPK(boolean isPk)
Change the PK property of the metafield.

Specified by:
setPK in interface MetaField
Parameters:
isPk - True if the metafield represents a primary key column, false otherwise.

setQueryPolicy

public void setQueryPolicy(int queryPolicy)
Changes the query policy for this column. Query policys could be SNAPSHOT or DYNASET.

Specified by:
setQueryPolicy in interface MetaField
Parameters:
queryPolicy - New value of property queryPolicy.
See Also:
pt.moredata.dao.DAOView.SNAPSHOT, pt.moredata.dao.DAOView.DYNASET

setSpecialType

public void setSpecialType(int specialType)
                    throws DAORuntimeException
Change the specialType property of the column represented by the meta field.

Specified by:
setSpecialType in interface MetaField
Parameters:
specialType - The column new special type.
Throws:
DAORuntimeException - se o campo for contador ou se o campo tiver um valor fixo.

setUpdateable

public void setUpdateable(boolean updateable)
Change the updateable property of the metafield.

Specified by:
setUpdateable in interface MetaField
Parameters:
updateable - True if the column represented by the meta field could be updated, false otherwise.

isRepositoryField

public boolean isRepositoryField()
Check if the field is a repository field.

Specified by:
isRepositoryField in interface MetaField
Returns:
True is the field is a repository field, false otherwise.

setRepositoryField

public void setRepositoryField(boolean repositoryField)
Setter for property repositoryField.

Specified by:
setRepositoryField in interface MetaField
Parameters:
repositoryField - True if the fiels is a repository field, false otherwise.

isDefaultValueEngineProcessed

public boolean isDefaultValueEngineProcessed()
Indicate if the default value is engine processed or not. <@return True if the default value is engine processed, false otherwise.

Specified by:
isDefaultValueEngineProcessed in interface MetaField

setDefaultValueEngineProcessed

public void setDefaultValueEngineProcessed(boolean defaultValueEngineProcessed)
Change the value of the defaultValueEngineProcessed property.

Specified by:
setDefaultValueEngineProcessed in interface MetaField
Parameters:
defaultValueEngineProcessed - New value of property defaultValueEngineProcessed, true if the default value should be processed by the data base engine, false otherwise.

isIncludeInQuery

public boolean isIncludeInQuery()
Check if the field should be include in a database selected.

Specified by:
isIncludeInQuery in interface MetaField
Returns:
true if the metafield should be included in a select, false otherwise.

setIncludeInQuery

public void setIncludeInQuery(boolean includeInQuery)
Change the includeInQuery property of the metafield.

Specified by:
setIncludeInQuery in interface MetaField
Parameters:
includeInQuery - true if the metafield should be incluede in the select, false if not.