SQL options in metadata

isPrimaryKey : boolean

defines whether the field is a primary key or part of a primary key.

mandatory : boolean

The mandatory attribute controls whether or not a null constraint should be defined on the table column.
Additionally a check method is added to the schema peer to determine whether all required fields are available. This can be used in conjunction with the version attribute and also creates the expected alter table ... not null statement in the update logic.


See the seperate section on foreign keys for an explanation and examples.

SQL specific options

the sqlOptions=@SqlFieldOptions( /* .. */ )  annotation groups SQL relevant options;

  • sqlColumn : String
    choose a different name of the table column instead of using the name of the attribute.
  • sqlAutoIncrement : boolean
    defines whether the value should be incremented by default when new datasets are inserted.
  • sqlDefault : String
    set the default value to pass to the create table / alter table ... add column definitions.
  • sqlType : String
    Override the standard type to be used in the SQL subsystem. Use with caution and check whether the type-mapping is adjusted accordingly.
  • sqlIndex : String[]
    Useful to create a table index on non-primary keys. Multiple fields can refer to the same index name. A combined index is created for those fields.
    A field can also be part of multiple index groups, set all index group names in the array for this case.
  • sqlUniqueGroup : String[]
    Just as for the index groups this sets a unique constraint to a field or combination of field. A field can be part of multiple ‘unique groups’ as well.

dataName : String description : String dataOptions : String[]
these attributes are for extensions, contents are not yet evaluated.