Overview

All data access methods in the DataSource interface operate with data values in the same format, as described below.

The data records that are read or written to the database are represented by the DataRecord object. The Data Record API provides access to visible fields and primary key field values, as instances of DataValue class. These include:

  • Fields specified by calling DataSource.addField() or DataSource.addVirtualField()
  • All primary key fields of the main data source table, even if they are not explicitly specified.

The DataValue object for each field contains a Java object representing field value. The supported types are:

java.lang.String
java.lang.Integer
java.lang.Float
java.lang.Double
java.sql.Date
java.sql.Time
java.sql.Timestamp

Every DataValue object has a reference to the corresponding field definition, which is set up by the DataSource. For physical database fields, this field definition is loaded from Archibus schema. For virtual fields representing results of a custom SQL query this field definition is synthetically created from properties specified in the addVirtualField() call. Field definitions are represented as instances of ViewField.Immutable interface.

Complex data sets with multiple data records is represented as instances of the DataSet interface. The supported data set types include:

  • DataSetList : a simple list of data records.
  • DataSet1D : a list of data records representing 1D view analysis results, with totals.
  • DataSet2D : a list of data records representing 2D view analysis results, with totals, subtotals for rows and columns, and a record index that allows the client code to find records by row and column.

Event-handler methods can accept DataRecord and DataSet objects as method parameters, and return them as method results. Web Central will automatically convert these objects into format used to send/receive data over the communication channel.