Class BindingItem

java.lang.Object
de.businesscode.bcdui.binding.SimpleBindingItem
de.businesscode.bcdui.binding.BindingItem
Direct Known Subclasses:
BindingItemFromRel, BindingItemWithMetaData, VirtualBindingItem

public class BindingItem extends SimpleBindingItem
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.
See Also:
  • Constructor Details

    • BindingItem

      public BindingItem(BindingItem src)
      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

      public Map<String,String> getCustomAttributesMap()
      Returns:
      the customAttributesMap
    • toString

      public String toString()
      A useful method for debugging.
      Overrides:
      toString in class Object
      Returns:
      A list of column expressions.
    • getColumnExpression

      public String 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 class SimpleBindingItem
      Returns:
      The SQL code - often just a column name - assigned to the BindingItem.
    • getJDBCDataType

      public Integer 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

      public void setJDBCDataType(Integer jdbcDataType)
      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
      Throws:
      IllegalArgumentException
      SecurityException
      IllegalAccessException
      NoSuchFieldException
    • getJDBCDataTypeName

      public String 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

      public void setJDBCColumnDisplaySize(Integer jdbcColumnDisplaySize)
    • getJDBCColumnDisplaySize

      public Integer 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

      public void setJDBCColumnScale(Integer jdbcColumnScale)
    • getJDBCColumnScale

      public Integer 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

      public void setJDBCSigned(Boolean jdbcSigned)
    • getJDBCSigned

      public Boolean 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

      public String getAggr()
      Default aggregator, when none is given in the Wrq
      Returns:
    • setAggr

      public void setAggr(String aggr)
    • setJDBCNullable

      public void setJDBCNullable(Integer jdbcNullable)
      Determines if the column can take a NULL value or not.
      See Also:
    • getJDBCNullable

      public Integer getJDBCNullable()
    • getReferencesAsNode

      public Node getReferencesAsNode() throws ParserConfigurationException, SAXException, IOException
      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

      public String getReferences()
      Gets the References element as serialized XML element.
      Returns:
      The References element in a string form.
    • setReferences

      public void setReferences(String references)
    • getDisplayFormat

      @Deprecated public String getDisplayFormat()
      Deprecated.
      This method should no longer be used. Instead the method getJDBCDataType() 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, ParserConfigurationException
      Deprecated.
      Use the method getJDBCDataType() instead.
      Gets the display format as an XML element.
      Returns:
      The XML element of the DisplayFormat node.
      Throws:
      SAXException
      IOException
      ParserConfigurationException
    • setDisplayFormat

      public void setDisplayFormat(String displayFormat)
    • getCaption

      public String getCaption()
      Gets value of caption attribute or empty string.
      Returns:
      The database column caption.
      See Also:
    • setCaption

      public void setCaption(String caption)
      Sets value of caption attribute.
      Parameters:
      caption - The new caption of the column.
    • isReadOnly

      public Boolean isReadOnly()
      gets if the BindingItem is read only
    • setReadOnly

      public void setReadOnly(Boolean isReadOnly)
      sets if the BindingItem is read only
      Parameters:
      isReadOnly -
    • isEscapeXML

      public Boolean isEscapeXML()
      Returns true if the content will be stored as an escaped XML string, otherwise it is plain XML
    • setEscapeXML

      public void setEscapeXML(Boolean isEscapeXML)
      If true, treats content as a string of escaped XML. Otherwise it is stored as XML type and returned as inline XML
    • toXML

      public void toXML(XMLStreamWriter writer, boolean withColumnExpression) throws XMLStreamException
      Prints an XML representation of the BindingItem.
      Overrides:
      toXML in class SimpleBindingItem
      Parameters:
      writer - The writer instance to print the data to.
      Throws:
      XMLStreamException
    • getAttributes

      public Map<String,Object> getAttributes()