Interface EntityDefinition.ForeignKeys

Enclosing interface:
EntityDefinition

public static interface EntityDefinition.ForeignKeys
Holds the foreign key definitions for an entity type
  • Method Details

    • definitions

      Returns:
      a list containing the foreign key definitions for this entity type
    • get

      Returns:
      all foreign keys for this entity type
    • referencedBy

      EntityDefinition referencedBy(ForeignKey foreignKey)
      Returns the EntityDefinition of the entity referenced by the given foreign key.
      Parameters:
      foreignKey - the foreign key
      Returns:
      the definition of the referenced entity
    • updatable

      boolean updatable(ForeignKey foreignKey)
      Parameters:
      foreignKey - the foreign key
      Returns:
      true if all the underlying columns are updatable
    • foreignKeyColumn

      boolean foreignKeyColumn(Column<?> column)
      Parameters:
      column - the column
      Returns:
      true if the given column is part of a foreign key
    • get

      Collection<ForeignKey> get(EntityType referencedEntityType)
      Returns the foreign keys referencing entities of the given type
      Parameters:
      referencedEntityType - the referenced entity type
      Returns:
      the foreign keys referencing the given entity type, an empty collection is returned in case no foreign keys are found
    • definition

      ForeignKeyDefinition definition(ForeignKey foreignKey)
      Parameters:
      foreignKey - the foreign key
      Returns:
      the ForeignKeyDefinition for the given foreign key
      Throws:
      IllegalArgumentException - in case no such foreign key exists
    • definitions

      <T> Collection<ForeignKeyDefinition> definitions(Column<T> column)
      Type Parameters:
      T - the attribute type
      Parameters:
      column - the column
      Returns:
      the ForeignKeyDefinitions associated with the given column, an empty collection in case none are found