logo

abstract const class

haven::ColDef

sys::Obj
  haven::ColDef

ColDef defines the mapping of a field in a Type to a column in a relational table.

Slots

allowNull

Bool allowNull()

Does this column allow null values to be persisted?

Source

columnName

virtual Str columnName()

Get the database column name.

Source

definition

virtual Str definition()

Get the definition of the column as it appears in a CREATE TABLE statement.

Source

field

Field field()

Source

fieldName

const Str fieldName

The field that this column represents. This field may be lazily loaded from the field qname if this column definition has been serialized.

Source

fieldToSql

Str fieldToSql(Obj o)

Convert the field value of this column for the specified object to SQL text.

Source

haven

const HavenService haven

The haven used by this column.

Source

index

IndexDef index()

Get the index definition for this column. If the column is not indexed, null is returned.

Source

isAuto

Bool isAuto()

Is this column value auto-generated?

Source

isIndexed

Bool isIndexed()

Is this column indexed?

Source

isKey

Bool isKey()

Is this column part of the primary key?

Source

isRef

Bool isRef()

Is this column a foreign key to another table?

Source

isUnique

Bool isUnique()

Is each value in this column unique?

Source

make

new make()

Protected no argument constructor for subclasses.

Source

makeForField

new makeForField(HavenService haven, Field field)

Make a new instance for the specified field.

Source

name

Str name()

Get the column name.

Source

paramValue

virtual Obj paramValue(Obj o, Str:Obj params := null)

Add a translated parameter or parameters to the specified map for use in a prepared statement.

Source

rowValue

abstract Obj rowValue(Row row, Col col)

Get a value for this column type from the specified row. This is used by ref columns to read their database values.

Source

setFieldFromRow

abstract Void setFieldFromRow(Obj obj, Row row, HavenNamespace ns)

Set the field for this column on the specified object by mapping the field value from the specified row.

Source

sqlType

abstract Str sqlType()

Get the SQL type definition for this translator

Source

toSql

abstract Str toSql(Obj o)

Convert an object to its equivalent SQL syntax.

Source

validate

virtual Void validate(Obj defaultRow)

Validate the field for this column from the default row.

Source