15.6. Column

In the previous section, we saw that the datastore-identity element can take either a column attribute or nested column elements. This option is repeated on many elements throughout mapping metadata. The motivation for this dualistic approach is to make the common case easy, but retain the flexibility to handle more complex scenarios. When a mapping has a single column with default properties, you can use the column attribute to just name the column. When, on the other hand, a mapping has multiple columns or columns with non-default properties, you can fall back to nested column elements. We saw this in Example 15.3, “Datastore Identity Mapping” above: most classes used the column attribute to simply name the primary key column, but Author and Magazine used a nested element in order to specify additional column information. Column elements have the following attributes:

[Note]Note

Kodo also defines extensions to mark that the current mapping should not attempt to insert or update a column's value. See Section 7.9.3, “Column Extensions” in the Reference Guide.

 

Skip navigation bar   Back to Top