struct Athena::ORM::Mapping::Field
inherits Struct
#
The mapping of a property to a column, as configured by AORMA::Column.
The field mappings of an entity are available from its class metadata, keyed by property name:
field = em.class_metadata(User).field_mappings["username"]
field.column_name # => "username"
field.type # => "string"
It has the following properties:
field_name- The name of the property.column_name- The name of the column, without quotes.type- The name of theAORM::Types::Typeused to convert the values.enum_type- The name of the enum type of an enum property, whose values are stored as integers.id- Whether the field is part of the identifier.not_insertable/not_updatable- Whether the column is left out ofINSERT/UPDATEstatements.quoted- Whether the column name was wrapped in backticks, so it's quoted in the generated SQL.length,precision,scale,unique,nullable,index,column_definition- Describe the column's schema.generated- Whether the database generates the column's value.
Todo
There's no schema tool yet, so the properties describing the column's schema are recorded but have no effect.
Todo
The generated property isn't supported yet; AORMA::Column(generated: ...) is a compile-time error.