In the previous section, we saw that a
uses an array of column names. Field mappings,
however, use full-fledged
Column annotations have the following properties:
String columnDefinition: The
database-specific column type name. This property is only used
by vendors that support creating tables from your mapping
metadata. During table creation, the vendor will use the value
columnDefinition as the declared
column type. If no
given, the vendor will choose an appropriate default based on
the field type combined with the column's length, precision,
int length: The column length. This
property is typically only used during table creation, though
some vendors might use it to validate data before flushing.
columns typically default to a length of 255; other
column types use the database default.
String table: Sometimes you will
need to map fields to tables other than the primary table.
This property allows you specify that the column resides in a
secondary table. We will see how to map fields to secondary
tables later in the chapter.
The equivalent XML element is
element has attributes that are exactly equivalent to the
Column annotation's properties described above: