|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pajes.db.entity.Attributes
public class Attributes
A representation of the atributes of a single column in a database entity.
| Constructor Summary | |
|---|---|
Attributes(Manager manager,
java.lang.String columnName,
java.lang.String tableName,
java.lang.String label,
int sqlType,
boolean primaryKey,
boolean autoIncrement)
Creates an entity attributes object. |
|
Attributes(Manager manager,
java.lang.String columnName,
java.lang.String tableName,
java.lang.String label,
int sqlType,
boolean primaryKey,
boolean autoIncrement,
boolean required)
Creates an entity attributes object. |
|
Attributes(Manager manager,
java.lang.String columnName,
java.lang.String tableName,
java.lang.String label,
int sqlType,
boolean primaryKey,
boolean autoIncrement,
boolean required,
java.text.Format parser)
Creates an entity attributes object. |
|
Attributes(Manager manager,
java.lang.String columnName,
java.lang.String tableName,
java.lang.String label,
int sqlType,
boolean primaryKey,
boolean autoIncrement,
boolean required,
java.text.Format parser,
int position,
boolean optimisticLockKey,
java.lang.Object defaultValue)
Creates an entity attributes object. |
|
| Method Summary | |
|---|---|
java.lang.String |
format(java.lang.Object value)
Returns a formatted value. |
java.lang.Object |
get(java.lang.String name)
Returns the specified user defined attribute. |
int |
getDataType()
Retrieves the SQL data type of this attribute. |
java.lang.Object |
getDefaultValue()
Gets the default value of this attribute. |
int |
getEditorPosition()
Returns the position down the page of this input field relative to the other columns when being displayed in the DefaultEditor. |
Input |
getInputField(Form form)
Returns an Input field that can be used to display and edit the value of this Entity. |
java.lang.String |
getLabel()
Returns the label for this attribute. |
int |
getListerPosition()
Returns the position of return this column relative to the other columns when being displayed in the DefaultLister. |
Manager |
getManager()
Returns the Manager object to which this attribute belongs. |
java.lang.String |
getName()
Returns the database column name that this attribute represents. |
java.lang.String |
getQualifiedName()
Returns the table-qualified database column name that this attribute represents. |
java.lang.String |
getTable()
Returns the name of the database table to which this attribute belongs. |
java.util.Set<java.lang.String> |
getUserDefinedAttributesNameSet()
Returns the set of user-defined attributes. |
int |
getViewerPosition()
Returns the position down the page of this element relative to the other columns when being displayed in the DefaultViewer. |
boolean |
isAutoIncrement()
Determines whether this attribute is automatically incremented by the database server. |
boolean |
isDate()
Determines if this attribute represents a date/time value or not. |
boolean |
isMandatory()
Determines if this attribute is required by the database server to have a value. |
boolean |
isNumeric()
Determines if this attribute represents a numeric value or not. |
boolean |
isOptimisticLockKey()
Determines whether this column will participate in determining whether the row has been changed or not. |
boolean |
isPrimaryKey()
Determines if this attribute is part of the primary key. |
boolean |
isReadOnly()
Determines if this attribute should be read only or not. |
java.lang.Object |
parse(java.lang.String value)
Converts the specified String into an Object of the correct type for this column. |
java.lang.Object |
put(java.lang.String name,
java.lang.Object value)
Creates a user-defined attribute. |
java.lang.Object |
remove(java.lang.String name)
Removes the specified user-defined attribute. |
void |
setAutoIncrement(boolean autoIncrement)
Sets whether or not this attribute is automatically incremented by the database server. |
void |
setDataType(int sqlType)
Sets the SQL data type of this attribute. |
void |
setDefaultValue(java.lang.Object defaultValue)
Sets the default value of this attribute, which will be used by the parse(java.lang.String) method if the String to be parsed is null or Select.NULL_ENTRY, or if the trimmed String equals "" and this attribute
is numeric or a date. |
void |
setEditorPosition(int position)
Determines the position down the page of this input field relative to the other columns when being displayed in the DefaultEditor. |
void |
setInputField(Input field)
Sets the HTML Input field that can be used to display and edit the value of this Entity. |
void |
setLabel(java.lang.String label)
Sets the default label for auto-generated maintenance screens. |
void |
setListerPosition(int position)
Determines the position of this column relative to the other columns when being displayed in the DefaultLister. |
void |
setMandatory(boolean required)
Determines if this attribute is required by the database server to have a value. |
void |
setOptimisticLockKey(boolean on)
Determines whether this column will participate in determining whether the row has been changed or not. |
void |
setParser(java.text.Format parser)
Specifies the object that will be used by the parse(java.lang.String) method to
convert a String to an object of the correct type. |
void |
setPrimaryKey(boolean primaryKey)
Determines whether this column participates in the primary key. |
void |
setReadOnly(boolean readOnly)
Determines if this attribute should be read only or not. |
void |
setViewerPosition(int position)
Determines the position down the page of this element relative to the other columns when being displayed in the DefaultViewer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Attributes(Manager manager,
java.lang.String columnName,
java.lang.String tableName,
java.lang.String label,
int sqlType,
boolean primaryKey,
boolean autoIncrement)
manager - the entity manager to which this attribute belongs.columnName - the name of the database column that this attribute
represents.tableName - the name of the database table to which this column belongs.
If null, it will default to the table defined in the Manager.label - the default label for auto-generated maintenance screens.sqlType - the java.sql.Types field that corresponds to
the data type of this attribute.primaryKey - true if this attribute is part of the primary key.autoIncrement - true if this attribute is automatically incremented by the
database server when inserting a new entity.
public Attributes(Manager manager,
java.lang.String columnName,
java.lang.String tableName,
java.lang.String label,
int sqlType,
boolean primaryKey,
boolean autoIncrement,
boolean required)
manager - the entity manager to which this attribute belongs.columnName - the name of the database column that this attribute
represents.tableName - the name of the database table to which this column belongs.
If null, it will default to the table defined in the Manager.label - the default label for auto-generated maintenance screens.sqlType - the java.sql.Types field that corresponds to
the data type of this attribute.primaryKey - true if this attribute is part of the primary key.autoIncrement - true if this attribute is automtically incremented by the
database server when inserting a new entity.required - true if this attribute is required by the database server to
have a value.
public Attributes(Manager manager,
java.lang.String columnName,
java.lang.String tableName,
java.lang.String label,
int sqlType,
boolean primaryKey,
boolean autoIncrement,
boolean required,
java.text.Format parser)
manager - the entity manager to which this attribute belongs.columnName - the name of the database column that this attribute
represents.tableName - the name of the database table to which this column belongs.
If null, it will default to the table defined in the Manager.label - the default label for auto-generated maintenance screens.sqlType - the java.sql.Types field that corresponds to
the data type of this attribute.primaryKey - true if this attribute is part of the primary key.autoIncrement - true if this attribute is automtically incremented by the
database server when inserting a new entity.required - true if this attribute is required by the database server to
have a value.parser - the Format object that will be used by the parse(java.lang.String)
method to convert a String to an object of the correct type.
public Attributes(Manager manager,
java.lang.String columnName,
java.lang.String tableName,
java.lang.String label,
int sqlType,
boolean primaryKey,
boolean autoIncrement,
boolean required,
java.text.Format parser,
int position,
boolean optimisticLockKey,
java.lang.Object defaultValue)
manager - the entity manager to which this attribute belongs.columnName - the name of the database column that this attribute
represents.tableName - the name of the database table to which this column belongs.
If null, it will default to the table defined in the Manager.label - the default label for auto-generated maintenance screens.sqlType - the java.sql.Types field that corresponds to
the data type of this attribute.primaryKey - true if this attribute is part of the primary key.autoIncrement - true if this attribute is automtically incremented by the
database server when inserting a new entity.required - true if this attribute is required by the database server to
have a value.parser - the Format object that will be used by the parse(java.lang.String)
method to convert a String to an object of the correct type.position - the default position of this field in the DefaultEditor, DefaultLister and
DefaultViewer. If the position is negative, this
field will not be displayed.optimisticLockKey - if true, this column will be included in a WHERE clause to
determine if the row has been changed.defaultValue - the default value of this attribute, which will be used by the
parse(java.lang.String) method if the String to be parsed is null or
Select.NULL_ENTRY, or if the trimmed String equals ""
and this attribute is numeric or a
date.| Method Detail |
|---|
public java.lang.String format(java.lang.Object value)
value - the value to be formatted.
public java.lang.Object get(java.lang.String name)
name - the user-defined attribute name.
public int getDataType()
public java.lang.Object getDefaultValue()
public int getEditorPosition()
DefaultEditor.
DefaultEditor. If the
position is negative, this field will not be displayed in
the editor.setEditorPosition(int)public Input getInputField(Form form)
setInputField(org.pajes.html.Input), a default
based on the data type will be used.
form - the HTML form on which the field will be placed.
setInputField(org.pajes.html.Input)public java.lang.String getLabel()
setLabel(java.lang.String)public int getListerPosition()
DefaultLister.
DefaultLister.
If the position is negative, return this column will not
be displayed in the list.setListerPosition(int)public Manager getManager()
public java.lang.String getName()
public java.lang.String getQualifiedName()
TABLE_NAME.COLUMN_NAME.public java.lang.String getTable()
public java.util.Set<java.lang.String> getUserDefinedAttributesNameSet()
public int getViewerPosition()
DefaultViewer.
DefaultViewer. If the
position is negative, this field will not be displayed in
the editor.setViewerPosition(int)public boolean isAutoIncrement()
public boolean isDate()
public boolean isMandatory()
public boolean isNumeric()
public boolean isOptimisticLockKey()
setOptimisticLockKey(boolean)public boolean isPrimaryKey()
setPrimaryKey(boolean)public boolean isReadOnly()
public java.lang.Object parse(java.lang.String value)
type for this column. If a parser has
been specified, that object will be used to parse the value. If not, an
attempt to parse the value based on the data type will be made.
value - the String value.
the default value if the
value was null or Select.NULL_ENTRY, or if the trimmed
value equals "" and this attribute is numeric
or a date.
EntityException - if a number format exception occurs.
public java.lang.Object put(java.lang.String name,
java.lang.Object value)
name - the user-defined attribute name.value - the value of the user-defined attribute.
public java.lang.Object remove(java.lang.String name)
name - the user-defined attribute name.
public void setAutoIncrement(boolean autoIncrement)
read-only.
autoIncrement - true if this attribute is automtically incremented by the
database server when inserting a new entity.public void setDataType(int sqlType)
input field to one of the correct type.
sqlType - the java.sql.Types field that corresponds to
the data type of this attribute.public void setDefaultValue(java.lang.Object defaultValue)
parse(java.lang.String) method if the String to be parsed is null or Select.NULL_ENTRY, or if the trimmed String equals "" and this attribute
is numeric or a date.
defaultValue - the default value.public void setEditorPosition(int position)
DefaultEditor. The
default value is determined by the order in which the Attributes are
registered with the Manager.
position - the position of this field in the DefaultEditor. If
the position is negative, this field will not be
displayed in the editor.getEditorPosition(),
Manager.getColumnPosition(java.lang.Class extends org.pajes.db.entity.MaintenanceDisplayElement>, org.pajes.db.entity.Attributes)public void setInputField(Input field)
data type will be used.
field - the input field to display or edit the value.getInputField(org.pajes.html.Form)public void setLabel(java.lang.String label)
label - the default label for auto-generated maintenance screens.getLabel()public void setListerPosition(int position)
DefaultLister. The default value is
determined by the order in which the Attributes are registered with the
Manager.
position - the position of this column in the DefaultLister. If
the position is negative, this column will not be
displayed in the list.getListerPosition(),
Manager.getColumnPosition(java.lang.Class extends org.pajes.db.entity.MaintenanceDisplayElement>, org.pajes.db.entity.Attributes)public void setMandatory(boolean required)
required - true if this attribute is required by the database server to
have a value.public void setOptimisticLockKey(boolean on)
on - if true, this column will be included in a WHERE clause to
determine if the row has been changed.isOptimisticLockKey()public void setParser(java.text.Format parser)
parse(java.lang.String) method to
convert a String to an object of the correct type.
parser - the Format object that will be used by the parse(java.lang.String)
method to convert a String to an object of the correct type.parse(java.lang.String)public void setPrimaryKey(boolean primaryKey)
primaryKey - true if this attribute is part of the primary key.isPrimaryKey()public void setReadOnly(boolean readOnly)
readOnly - true if this attribute should be read only.public void setViewerPosition(int position)
DefaultViewer. The
default value is determined by the order in which the Attributes are
registered with the Manager.
position - the position of this element in the DefaultViewer. If
the position is negative, this field will not be
displayed in the editor.getViewerPosition(),
Manager.getColumnPosition(java.lang.Class extends org.pajes.db.entity.MaintenanceDisplayElement>, org.pajes.db.entity.Attributes)
|
PAJES 3.0.21 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||