Interface ForeignKeyDefinition.Builder

All Superinterfaces:
AttributeDefinition.Builder<Entity,ForeignKeyDefinition.Builder>
Enclosing interface:
ForeignKeyDefinition

public static interface ForeignKeyDefinition.Builder extends AttributeDefinition.Builder<Entity,ForeignKeyDefinition.Builder>
  • Method Details

    • soft

      ForeignKeyDefinition.Builder soft(boolean soft)
      Marks this foreign key as being soft, that is, not based on a physical (table) foreign key and should not prevent deletion
      Parameters:
      soft - if true then this foreign key is marked as a non-physical soft key
      Returns:
      this instance
    • readOnly

      ForeignKeyDefinition.Builder readOnly(Column<?> column)
      Marks the given foreign key reference column as read-only, which causes an exception being thrown when the given column value is modified via this foreign key.
      Parameters:
      column - the reference column
      Returns:
      this instance
    • attributes

      ForeignKeyDefinition.Builder attributes(Attribute<?>... attributes)
      Specifies the attributes from the referenced entity to select. Note that the primary key attributes are always selected and do not have to be added via this method.
      Parameters:
      attributes - the attributes to select
      Returns:
      this instance
    • referenceDepth

      ForeignKeyDefinition.Builder referenceDepth(int referenceDepth)
      Specifies the default query reference depth for this foreign key.
       Reference depth:
       -1: the full foreign key graph of the referenced entity is fetched.
        0: the referenced entity not fetched.
        1: the referenced entity is fetched, without any foreign key references.
        2: the referenced entity is fetched, with a single level of foreign key references.
        3: the referenced entity is fetched, with two levels of foreign key references.
        etc...
       
      Parameters:
      referenceDepth - the number of levels of foreign key references to fetch for this foreign key
      Returns:
      this instance
      Throws:
      IllegalArgumentException - in case reference depth is less than -1