Data types - DbRecord
warning
Using DbRecord instead of entities will circumvent compile-time validation of database interactions. This means that errors might not appear until runtime or might lead to unexpected results.
DbRecord enables you to build a record of a specified table. It is not type-safe, so this is not our recommended method.
Constructors
| Signature | Description |
|---|---|
constructor(tableName: String) | Create record with specified table name. |
constructor(source: DbRecord?) | Clone existing record. |
constructor(targetTableName: String, source: DbRecord?) | Clone an existing record into another record belonging to a different table. This is useful when the target table record is the extended table of the source record. |
Example
val tradeRecord = DbRecord("TRADE")
val clonedTradeRecord = DbRecord(tradeRecord)
DbRecord("TRADE_SUMMARY", tradeRecord)
functions
Use the functions below to set and get fields of DbRecord. The field type can be any of these types.
Set record
fun set{DataType}(column: String, value: {DataType}?) You need to specify name and value of the column. DataType represents the type of the field you are trying to set.
If you are trying to set a Double field, the method would look like this: fun setDouble(column: String, value: Double?); the value needs to be non-null.