Package de.businesscode.bcdui.binding
Class BindingItem
java.lang.Object
de.businesscode.bcdui.binding.SimpleBindingItem
de.businesscode.bcdui.binding.BindingItem
- Direct Known Subclasses:
BindingItemFromRel
,BindingItemWithMetaData
,VirtualBindingItem
The BindingItem class represents a mapping from a logical name to a
database column. These classes are contained inside BindingSets and
constructed by the Bindings class from static XML files.
database column. These classes are contained inside BindingSets and
constructed by the Bindings class from static XML files.
- See Also:
-
Field Summary
Fields inherited from class de.businesscode.bcdui.binding.SimpleBindingItem
BCD_NO_TABLE_ALIAS, columnExpression, pureColumnNamePattern, qColumnExpr, wordPattern
-
Constructor Summary
ConstructorsConstructorDescriptionBindingItem
(BindingItem src) Copy constructor.BindingItem
(String pName, String pColumnExpression, boolean pColumnQuoting, BindingSet pBindingSet) Constructs a BindingItem. -
Method Summary
Modifier and TypeMethodDescriptiongetAggr()
Default aggregator, when none is given in the WrqGets value of caption attribute or empty string.Gets the column expression for a BindingItem.Deprecated.This method should no longer be used.Deprecated.Use the methodgetJDBCDataType()
instead.Retrieves the number of characters for this column.Gets the number of decimal places if this is a numeric column.The basic type of the database column which can be String or Number.Gets the name of the JDBC data type.Indicates whether the column allows negative numbers or not.Gets the References element as serialized XML element.Retrieves the content of the References element as a w3c.Node or NULL if there is no References element.boolean
Returns true if the content will be stored as an escaped XML string, otherwise it is plain XMLboolean
isKey()
Tests if the BindingItem is marked as a key column in the BindingSet.boolean
gets if the BindingItem is read onlyvoid
void
setCaption
(String caption) Sets value of caption attribute.void
setDisplayFormat
(String displayFormat) void
setEscapeXML
(Boolean isEscapeXML) If true, treats content as a string of escaped XML.void
setJDBCColumnDisplaySize
(Integer jdbcColumnDisplaySize) void
setJDBCColumnScale
(Integer jdbcColumnScale) void
setJDBCDataType
(Integer jdbcDataType) The basic type of the database column which can be String or Number.void
setJDBCDataTypeName
(String jdbcDataTypeName) void
setJDBCNullable
(Integer jdbcNullable) Determines if the column can take a NULL value or not.void
setJDBCSigned
(Boolean jdbcSigned) void
setKey
(boolean isKey) void
setReadOnly
(Boolean isReadOnly) sets if the BindingItem is read onlyvoid
setReferences
(String references) toString()
A useful method for debugging.void
toXML
(XMLStreamWriter writer, boolean withColumnExpression) Prints an XML representation of the BindingItem.Methods inherited from class de.businesscode.bcdui.binding.SimpleBindingItem
getBindingSet, getDescription, getId, getQColumnExpression, isColumnQuoting, setBindingSet, setColumnExpression, setDescription, setId
-
Constructor Details
-
BindingItem
Copy constructor. -
BindingItem
public BindingItem(String pName, String pColumnExpression, boolean pColumnQuoting, BindingSet pBindingSet) Constructs a BindingItem.- Parameters:
pName
- The name of the BindingItem.pBindingSet
- The BindingSet.
in the SQL code generated from the BindingItem.pColumnExpression
- A list of database columns for the BindingItems.
Since multi-bindings are no longer supported this list should contain exactly one item.pColumnQuoting
- True, if the columnExpression should be in quotes or not.
For some reserved keyword of the database it is necessary to place the
column name in quotes.
-
-
Method Details
-
getCustomAttributesMap
- Returns:
- the customAttributesMap
-
toString
A useful method for debugging. -
getColumnExpression
Gets the column expression for a BindingItem. In many cases this is just a database column name, but it can be a simple SQL expression as well.- Overrides:
getColumnExpression
in classSimpleBindingItem
- Returns:
- The SQL code - often just a column name - assigned to the BindingItem.
-
getJDBCDataType
The basic type of the database column which can be String or Number.- Returns:
- The abstract column type of the database column.
-
isDefinedJDBCDataType
public boolean isDefinedJDBCDataType() -
isNumeric
public boolean isNumeric() -
setJDBCDataType
The basic type of the database column which can be String or Number. -
isKey
public boolean isKey()Tests if the BindingItem is marked as a key column in the BindingSet.- Returns:
- True if this BindingItem is a key item.
-
setKey
public void setKey(boolean isKey) -
setJDBCDataTypeName
public void setJDBCDataTypeName(String jdbcDataTypeName) throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException -
getJDBCDataTypeName
Gets the name of the JDBC data type.- Returns:
- A string corresponding to the constant name of the JDBC data type. The names are listed in java.sql.Types.
- See Also:
-
setJDBCColumnDisplaySize
-
getJDBCColumnDisplaySize
Retrieves the number of characters for this column.- Returns:
- The size of the column as number of characters. It can be NULL if this value is not set in the BindingSet.
- See Also:
-
setJDBCColumnScale
-
getJDBCColumnScale
Gets the number of decimal places if this is a numeric column. An integer number has 0 decimal places.- Returns:
- The number of positions after the decimal point. This can be NULL if the value has not been specified.
- See Also:
-
setJDBCSigned
-
getJDBCSigned
Indicates whether the column allows negative numbers or not.- Returns:
- True if negative numbers are allowed. The result can be NULL if this property has not been set.
- See Also:
-
getAggr
Default aggregator, when none is given in the Wrq- Returns:
-
setAggr
-
setJDBCNullable
Determines if the column can take a NULL value or not.- See Also:
-
getJDBCNullable
-
getReferencesAsNode
Retrieves the content of the References element as a w3c.Node or NULL if there is no References element.- Returns:
- The References element or NULL if there is no such element.
- Throws:
ParserConfigurationException
SAXException
IOException
-
getReferences
Gets the References element as serialized XML element.- Returns:
- The References element in a string form.
-
setReferences
-
getDisplayFormat
Deprecated.This method should no longer be used. Instead the methodgetJDBCDataType()
can be called.Gets the display format of the column as XML Schema data type.- Returns:
- The XML schema data type of the column.
-
getDisplayFormatAsNode
@Deprecated public Node getDisplayFormatAsNode() throws SAXException, IOException, ParserConfigurationExceptionDeprecated.Use the methodgetJDBCDataType()
instead.Gets the display format as an XML element.- Returns:
- The XML element of the DisplayFormat node.
- Throws:
SAXException
IOException
ParserConfigurationException
-
setDisplayFormat
-
getCaption
Gets value of caption attribute or empty string.- Returns:
- The database column caption.
- See Also:
-
setCaption
Sets value of caption attribute.- Parameters:
caption
- The new caption of the column.
-
isReadOnly
gets if the BindingItem is read only -
setReadOnly
sets if the BindingItem is read only- Parameters:
isReadOnly
-
-
isEscapeXML
Returns true if the content will be stored as an escaped XML string, otherwise it is plain XML -
setEscapeXML
If true, treats content as a string of escaped XML. Otherwise it is stored as XML type and returned as inline XML -
toXML
Prints an XML representation of the BindingItem.- Overrides:
toXML
in classSimpleBindingItem
- Parameters:
writer
- The writer instance to print the data to.- Throws:
XMLStreamException
-
getAttributes
-