Module storm
Package st.orm

Annotation Interface FK


Marks a field as a foreign key. You can specify the foreign key’s database column name using either: Both attributes are aliases. If both are specified, they must have the same value.

Usage examples:

  • @FK("user_id")
  • @FK(name="user_id")
  • @FK @DbColumn("user_id")
Each sets the foreign key’s database column name to "user_id".

If no value is specified (i.e., both value() and name() are set to ""), an automatic column name resolution strategy will be applied.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The database column name for the foreign key.
    The database column name for the foreign key.
  • Element Details

    • value

      String value
      The database column name for the foreign key. Acts as an alias for name().
      Default:
      ""
    • name

      String name
      The database column name for the foreign key. Acts as an alias for value().
      Default:
      ""