pt.moredata.dao
Interface MetaField

All Known Implementing Classes:
pt.moredata.dao.core.GenericMetaField

public interface MetaField

This is the interface used for representing one column of the DataAccessObject. Company MoreData

Version:
$Revision: 1.7 $
Author:
pcarmo

Field Summary
static int NONE
          Ordinary column type.
static int SERIAL
          SERIAL columnm yype.
 
Method Summary
 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()
          Return the table alias of the column represented by the meta field.
 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 numChars)
          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.
 

Field Detail

NONE

public static final int NONE
Ordinary column type.

See Also:
Constant Field Values

SERIAL

public static final int SERIAL
SERIAL columnm yype.

See Also:
Constant Field Values
Method Detail

getColumnName

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

Returns:
The meta field column name.

getDAOIndex

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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()
Return the table alias of the column represented by the meta field.

Returns:
The table alias of the column represented by the meta field.

isAcceptNull

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

Returns:
True if the column represented by the meta field accepts null as value 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.


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.

Returns:
True if the column is a counter column, false otherwise.

isFK

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

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.

Returns:
True is the column is a primary key column, false otherwise.

isRepositoryField

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

Returns:
True is the field is a repository field, false otherwise.

isUpdateable

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

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.

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.

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.

Parameters:
index - The DAO index of the column represented by this MetaField.

setDataType

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

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.

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.

Parameters:
value - The new default value of the column.

setDefaultValueEngineProcessed

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

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

setFK

public void setFK(boolean isFk)
Change the FK property of the 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.

Parameters:
label - The new column label.

setLength

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

Parameters:
numChars - The new column length (characters number).

setPK

public void setPK(boolean isPk)
Change the PK property of the 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.

Parameters:
queryPolicy - New value of property queryPolicy.
See Also:
pt.moredata.dao.DAOView.SNAPSHOT, pt.moredata.dao.DAOView.DYNASET

setRepositoryField

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

Parameters:
repositoryField - True if the fiels is a repository field, false otherwise.

setSpecialType

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

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.

Parameters:
updateable - True if the column represented by the meta field could be updated, false otherwise.

isIncludeInQuery

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

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.

Parameters:
includeInQuery - true if the metafield should be incluede in the select, false if not.