ValueData

data class ValueData(var id: Int = valueDataCounter++, var modaName: String = "", var alternative: String = "", var metricName: String = "", var metricValue: Double = 0.0, var rank: Double = 0.0) : DbTableData

Constructors

Link copied to clipboard
constructor(id: Int = valueDataCounter++, modaName: String = "", alternative: String = "", metricName: String = "", metricValue: Double = 0.0, rank: Double = 0.0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val autoIncField: Boolean = false
Link copied to clipboard
var id: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The number of columns of data. The number of public mutable properties including any auto-increment field

Link copied to clipboard

The number of fields to insert. If there is an auto-increment field then it is not included.

Link copied to clipboard

The number of fields to update. This does not include the fields within the primary key

Link copied to clipboard
Link copied to clipboard

The optional name of the schema holding the table for the related data. If supplied it cannot be empty/blank and any white space will be replaced with underscore characters.

Link copied to clipboard

White space in the string is replaced by an underscore

Functions

Link copied to clipboard

Creates a string representation of a CREATE TABLE SQL statement that could create a table that would hold the data associated with the DbTableData. The resulting string maps the property KTypes to suitable SQL types via DbTableData.toSQLTypeString. If there is a primary key specification, it is captured in the CREATE TABLE statement. Any NOT NULL specifications are also captured. There will not be any foreign key specifications because DbTableData does not specify them. Also, since there is no SQL standard for an auto-increment primary key, the autoIncField specification is ignored. The purpose here is to get a quick and dirty table representation. If additional specifications are required the user could formulate ALTER TABLE statements or better yet use one of the many libraries available for more advanced SQL work. If schemaName is supplied, then the CREATE TABLE statement begins with "CREATE TABLE schemaName.tableName ". If the schema name is not specified, the statement begins with "CREATE TABLE tableName "

Link copied to clipboard

Extracts the value of the public mutable properties of a data class If the object is not an instance of a data class, then the returned map will be empty. The map contains the pairs of (name, value) where name is the name of the public, mutable property and value is the current value of the property

Link copied to clipboard

Extracts the property of the public mutable properties of a data class Classifies each property whether it can be converted to a numeric value via isNumericConvertable(). All non-numeric mutable properties are considered TEXT; otherwise, they are considered NUMERIC.

Link copied to clipboard

The map will contain the fields and their values that are designated as part of the primary key

Link copied to clipboard

Extracts the current value of the fields that are designated as part of the primary key in the order in which the properties are listed within the class definition

Link copied to clipboard

Extracts the property of the public mutable properties of a data class If the object is not an instance of a data class, then the returned map will be empty. The map contains the pairs of (name, property) where name is the name of the public property and property is the reflection property

Link copied to clipboard

The map will contain all the fields by name with their values without an auto-increment field if it exists

Link copied to clipboard

The map will contain the fields and their values that are not designated as part of the primary key

Link copied to clipboard

Extracts the names of the public, mutable properties of a data class in the order in which they are declared in the primary constructor.

Link copied to clipboard
fun extractPropertyValues(autoInc: Boolean = false): List<Any?>

Extracts the value of the public, mutable properties of a data class in the order in which they are declared in the primary constructor.

Extracts the values of the public, mutable properties of a data class in the order in which they are declared in the primary constructor.

Link copied to clipboard

Extracts the names of the fields that can be updated or inserted by accounting for an auto-increment key field

Link copied to clipboard

Extracts the value of the public, mutable properties of a data class in the order in which they are declared in the primary constructor not including the fields designated as being within the primary key. We assume that the values returned correspond to data that must be used to update a record within the database table. Thus, we assume that the user will not update the values of the fields within the primary key. The returned values are in the order of the properties listed in the DbTableData class, not including the primary key fields.

Link copied to clipboard

Checks if an autoIncField exists

Link copied to clipboard

Returns a string representation of a table insert statement. See DatabaseIfc.insertIntoTableStatementSQL

Link copied to clipboard
fun setAutoIncField(value: Any?)

Sets the value of the auto-increment field based on the supplied value

Link copied to clipboard
fun setPropertyValues(values: List<Any?>)

Sets the values of the public mutable properties of a data class to the values supplied. If the object is not an instance of a data class then nothing happens. The size of the supplied list must be the same as the number of the mutable properties and the type of each element in the supplied list must match the type of the mutable property

Sets the values of the public mutable properties of a data class to the values supplied. If the object is not an instance of a data class then nothing happens. The row from a TabularFile must map to the property values

Link copied to clipboard

Returns a string representation of a table update statement. See DatabaseIfc.updateTableStatementSQL