|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.iplanet.jato.model.sql.QueryFieldDescriptor
Encapsulates the metadata needed to describe a QueryModel logical field.
The QueryModelBase implementation relies on a collection of QueryFieldDescriptors to supply the metadata that is used to dynamically construct and execute the SQL query. To this end, the descriptor contains metadata which describes the physical table column, such as the column name and whether it is a primary key. The descriptor also contains metadata that specifies rules for what the QueryModelBase should do in the even that no value is present for the field at the time of query execution.
Additionally, QueryModelBase relies on the descriptor to provide the
logical model field name and type. It is the logical field, not the column name,
that the model interface exposes via the Model.getValue(String)
and setValue(String, Object)
operations, amongst others.
This allows application developers to access the model's logical fields
in an object oriented fashion.
Internally, QueryModelBase will map the logical field to the physical
column as needed.
Note, the name of the logical model field may be, but need not be identical with the column name.
QueryFieldSchema
,
QueryModel
,
QueryModelBase
, Serialized FormField Summary | |
static int |
APPLICATION_INSERT_VALUE_SOURCE
The application provides the inserted value (default) |
static int |
DATABASE_INSERT_VALUE_SOURCE
The database provides the inserted value (no value is sent) |
static int |
FORMULA_INSERT_VALUE_SOURCE
The insertFormula property is is the inserted value |
static int |
ON_EMPTY_VALUE_EXCLUDE
If no value is provided, don't supply a value (default) |
static int |
ON_EMPTY_VALUE_SEND_NULL
If no value is provided, send NULL to the database |
static int |
ON_EMPTY_VALUE_USE_FORMULA
If no value is provided, emptyFormula is the provided value |
static int |
QUERY_TYPE_DELETE
field capable of participation in delete queries |
static int |
QUERY_TYPE_INSERT
field capable of participation in insert queries |
static int |
QUERY_TYPE_NONE
field not capable of participation in any queries |
static int |
QUERY_TYPE_SELECT
field capable of participation in select queries |
static int |
QUERY_TYPE_UPDATE
field capable of participation in update queries |
Constructor Summary | |
QueryFieldDescriptor()
Default constructor. |
|
QueryFieldDescriptor(java.lang.String logicalName,
java.lang.String columnName,
java.lang.String qualifiedColumnName,
java.lang.Class fieldClass)
Minimal recommended constructor. |
|
QueryFieldDescriptor(java.lang.String logicalName,
java.lang.String columnName,
java.lang.String qualifiedColumnName,
java.lang.Class fieldClass,
boolean isKey)
Optional constructor allows the key property to be assigned. |
|
QueryFieldDescriptor(java.lang.String logicalName,
java.lang.String columnName,
java.lang.String qualifiedColumnName,
java.lang.Class fieldClass,
boolean isKey,
boolean isComputedField,
int insertValueSource,
java.lang.String insertFormula,
int onEmptyValuePolicy,
java.lang.String emptyFormula)
Full constructor which allows additional properties to be assigned including parameters associated with computed fields, insert behavior and empty value considerations. |
|
QueryFieldDescriptor(java.lang.String logicalName,
java.lang.String columnName,
java.lang.String qualifiedColumnName,
java.lang.Class fieldClass,
boolean isKey,
boolean isComputedField,
int insertValueSource,
java.lang.String insertFormula,
int onEmptyValuePolicy,
java.lang.String emptyFormula,
int queryTypeMask)
Complete constructor allows the queryTypeMask property to be assigned. |
Method Summary | |
void |
enableQueryType(int value)
adds a supported query type to the mask |
java.lang.String |
getColumnName()
Short name of the relational database table/view column. |
java.lang.String |
getEmptyFormula()
Expression which replaced empty value when ON_EMPTY_VALUE_USE_FORMULA |
java.lang.String |
getEmptyValue()
|
java.lang.Class |
getFieldClass()
Java type, usually a JDBC SQL type, which assignable from the JDBC results. |
java.lang.String |
getInsertFormula()
SQL expression to be used by inserting query when FORMULA_INSERT_VALUE_SOURCE |
int |
getInsertValueSource()
Describes where a value for this field comes from when participating in an inserting query. |
java.lang.String |
getName()
The arbitrary logical name of this field. |
int |
getOnEmptyValuePolicy()
Describes how a query should behave when faced with an empty value for this field. |
java.lang.String |
getQualifiedColumnName()
Fully qualified name of the relational database table/view column which may be RDBMS implementation dependent but generally includes schema name uses '.' for a delimiter. |
int |
getQueryTypeMask()
Bit mask indicating type of queries which this field can participate in. |
boolean |
isComputedField()
Indicates whether this field represents an arbitary SQL expression as opposed to a mapping of a relational database table/view column. |
boolean |
isKey()
Indicator of whether this field represents a relational database table/view column which is a key or part of a compound key. |
boolean |
isQueryTypeEnabled(int value)
checks the support for a query type |
void |
setColumnName(java.lang.String value)
Returns the short name of the relational database table/view column. |
void |
setComputedField(boolean value)
|
void |
setEmptyFormula(java.lang.String value)
|
void |
setEmptyValue(java.lang.String value)
|
void |
setFieldClass(java.lang.Class value)
|
void |
setInsertFormula(java.lang.String value)
|
void |
setInsertValueSource(int value)
|
void |
setKey(boolean value)
|
void |
setName(java.lang.String value)
|
void |
setOnEmptyValuePolicy(int value)
|
void |
setQualifiedColumnName(java.lang.String value)
|
void |
setQueryTypeMask(int value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int APPLICATION_INSERT_VALUE_SOURCE
public static final int DATABASE_INSERT_VALUE_SOURCE
public static final int FORMULA_INSERT_VALUE_SOURCE
public static final int ON_EMPTY_VALUE_EXCLUDE
public static final int ON_EMPTY_VALUE_SEND_NULL
public static final int ON_EMPTY_VALUE_USE_FORMULA
public static final int QUERY_TYPE_NONE
public static final int QUERY_TYPE_SELECT
public static final int QUERY_TYPE_INSERT
public static final int QUERY_TYPE_UPDATE
public static final int QUERY_TYPE_DELETE
Constructor Detail |
public QueryFieldDescriptor()
public QueryFieldDescriptor(java.lang.String logicalName, java.lang.String columnName, java.lang.String qualifiedColumnName, java.lang.Class fieldClass)
key = false isComputedField = false insertValueSource =APPLICATION_INSERT_VALUE_SOURCE
insertFormula = null onEmptyValuePolicy =ON_EMPTY_VALUE_EXCLUDE
emptyFormula = null queryTypeMask =QUERY_TYPE_SELECT
|QUERY_TYPE_INSERT
|QUERY_TYPE_UPDATE
|QUERY_TYPE_DELETE
logicalName
- identifier of this metadata entity, not to be confused with the actual RDBMS column namecolumnName
- short name of the relational database table/view columnqualifiedColumnName
- fully scoped column namefieldClass
- assigns a Java type to this relational entityOptional Constructor
public QueryFieldDescriptor(java.lang.String logicalName, java.lang.String columnName, java.lang.String qualifiedColumnName, java.lang.Class fieldClass, boolean isKey)
key
property to be assigned.
The remaining property values are set to the following defaults:isKey
- indicates whether this relation entity is a key or is part of a keyCommon constructor parameters
,
Full Constructor
public QueryFieldDescriptor(java.lang.String logicalName, java.lang.String columnName, java.lang.String qualifiedColumnName, java.lang.Class fieldClass, boolean isKey, boolean isComputedField, int insertValueSource, java.lang.String insertFormula, int onEmptyValuePolicy, java.lang.String emptyFormula)
isKey
- indicates relational entity is a key or is part of a compound keyisComputedField
- indicates field is an SQL expression not necessarily related to table/view columnsinsertValueSource
- (see property accessor
)insertFormula
- SQL expression used when insertValueSource = FORMULA_INSERT_VALUE_SOURCE
onEmptyValuePolicy
- (see property accessor
)emptyFormula
- expression used when onEmptyValuePolicy = ON_EMPTY_VALUE_USE_FORMULA
Common constructor parameters
,
Complete Constructor
public QueryFieldDescriptor(java.lang.String logicalName, java.lang.String columnName, java.lang.String qualifiedColumnName, java.lang.Class fieldClass, boolean isKey, boolean isComputedField, int insertValueSource, java.lang.String insertFormula, int onEmptyValuePolicy, java.lang.String emptyFormula, int queryTypeMask)
queryTypeMask
property to be assigned.queryTypeMask
- indicates types of queries which this field may particpate in (see property accessor
)Common constructor parameters
,
Full Constructor
Method Detail |
public java.lang.String getName()
public void setName(java.lang.String value)
public java.lang.String getColumnName()
public void setColumnName(java.lang.String value)
public java.lang.String getQualifiedColumnName()
public void setQualifiedColumnName(java.lang.String value)
public java.lang.Class getFieldClass()
public void setFieldClass(java.lang.Class value)
public boolean isKey()
public void setKey(boolean value)
public boolean isComputedField()
public void setComputedField(boolean value)
public int getInsertValueSource()
public void setInsertValueSource(int value)
value
- one of the following constants:
APPLICATION_INSERT_VALUE_SOURCE
DATABASE_INSERT_VALUE_SOURCE
FORMULA_INSERT_VALUE_SOURCE
public int getOnEmptyValuePolicy()
public void setOnEmptyValuePolicy(int value)
value
- one of the following constants:
ON_EMPTY_VALUE_EXCLUDE
ON_EMPTY_VALUE_SEND_NULL
ON_EMPTY_VALUE_USE_FORMULA
public java.lang.String getEmptyFormula()
ON_EMPTY_VALUE_USE_FORMULA
public void setEmptyFormula(java.lang.String value)
value
- valid expression properly formed for this fields type.public java.lang.String getInsertFormula()
FORMULA_INSERT_VALUE_SOURCE
public void setInsertFormula(java.lang.String value)
value
- valid SQL expression properly formed for this field's typepublic java.lang.String getEmptyValue()
getEmptyFormula()
public void setEmptyValue(java.lang.String value)
setEmptyFormula(String)
public int getQueryTypeMask()
public void setQueryTypeMask(int value)
value
- set to QUERY_TYPE_NONE
or a combination of any of the following constants:
QUERY_TYPE_SELECT
QUERY_TYPE_INSERT
QUERY_TYPE_UPDATE
QUERY_TYPE_DELETE
public void enableQueryType(int value)
public boolean isQueryTypeEnabled(int value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |