Interface ForeignKeyProperty

  • All Superinterfaces:
    Property<Entity>

    public interface ForeignKeyProperty
    extends Property<Entity>
    A property that represents a reference to another entity, typically but not necessarily based on a foreign key.
    • Method Detail

      • attribute

        ForeignKey attribute()
        Description copied from interface: Property
        The Attribute this property is based on, should be unique within an Entity. By default, the Attribute.name() serves as column name for database properties.
        Specified by:
        attribute in interface Property<Entity>
        Returns:
        the foreign key attribute this property is based on.
      • referencedType

        EntityType referencedType()
        Returns:
        the type of the entity referenced by this foreign key
      • fetchDepth

        int fetchDepth()
        Returns:
        the default query fetch depth for this foreign key
      • isSoftReference

        boolean isSoftReference()
        Returns:
        true if this foreign key is not based on a physical (table) foreign key and should not prevent deletion
      • isReadOnly

        boolean isReadOnly​(Attribute<?> referenceAttribute)
        Returns true if the given foreign key reference attribute as read-only, as in, not updated when the foreign key value is set.
        Parameters:
        referenceAttribute - the reference attribute
        Returns:
        true if the given foreign key reference attribute as read-only
      • selectAttributes

        List<Attribute<?>> selectAttributes()
        Returns:
        the attributes to select when fetching entities referenced via this foreign key, an empty list in case of all attributes