Class ForeignKey

java.lang.Object
org.ivoa.dm.tapschema.ForeignKey
All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations, org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>

@Entity @VoDml(id="tapschema:ForeignKey", role=objectType) public class ForeignKey extends Object implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
foreign key definition.

objectType: ForeignKey

  • Field Details

    • key_id

      @VoDml(id="tapschema:ForeignKey.key_id", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String key_id
      the id of the key. : Attribute key_id : multiplicity 1
    • target_table

      @VoDml(id="tapschema:ForeignKey.target_table", role=reference, type="tapschema:table", typeRole=objectType) protected Table target_table
      ReferenceObject target_table : . ( Multiplicity : 1 )
    • description

      @VoDml(id="tapschema:ForeignKey.description", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String description
      description. : Attribute description : multiplicity 0..1
    • utype

      @VoDml(id="tapschema:ForeignKey.utype", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String utype
      utype. : Attribute utype : multiplicity 0..1
    • columns

      @VoDml(id="tapschema:ForeignKey.columns", role=composition, type="tapschema:FKColumn", typeRole=objectType) protected List<FKColumn> columns
      . composition columns : ( Multiplicity : 1..* )
  • Constructor Details

    • ForeignKey

      public ForeignKey()
      Creates a new ForeignKey
    • ForeignKey

      public ForeignKey(String key_id, Table target_table, String description, String utype, List<FKColumn> columns)
      full parameter constructor.
      Parameters:
      key_id - the id of the key.
      target_table - .
      description - description.
      utype - utype.
      columns - .
    • ForeignKey

      public ForeignKey(ForeignKey other)
      Copy Constructor. Note that references will remain as is rather than be copied.
      Parameters:
      other - the object to be copied.
  • Method Details

    • updateClonedReferences

      public void updateClonedReferences()
      updates any cloned references that are contained within the hierarchy.
    • updateUsing

      public void updateUsing(ForeignKey other)
      Update this object with the content of the given object. Note that references will remain as is rather than be copied.
      Parameters:
      other - the object to be copied.
    • getKey_id

      public String getKey_id()
      Returns key_id Attribute.
      Returns:
      key_id Attribute
    • setKey_id

      public void setKey_id(String pKey_id)
      Set key_id Attribute.
      Parameters:
      pKey_id - value to set
    • withKey_id

      public ForeignKey withKey_id(String pKey_id)
      fluent setter for key_id Attribute.
      Parameters:
      pKey_id - value to set
      Returns:
      ForeignKey
    • getTarget_table

      public Table getTarget_table()
      Returns target_table Reference
      Returns:
      target_table Reference
    • setTarget_table

      public void setTarget_table(Table pTarget_table)
      Defines target_table Reference
      Parameters:
      pTarget_table - reference to set
    • getDescription

      public String getDescription()
      Returns description Attribute.
      Returns:
      description Attribute
    • setDescription

      public void setDescription(String pDescription)
      Set description Attribute.
      Parameters:
      pDescription - value to set
    • withDescription

      public ForeignKey withDescription(String pDescription)
      fluent setter for description Attribute.
      Parameters:
      pDescription - value to set
      Returns:
      ForeignKey
    • getUtype

      public String getUtype()
      Returns utype Attribute.
      Returns:
      utype Attribute
    • setUtype

      public void setUtype(String pUtype)
      Set utype Attribute.
      Parameters:
      pUtype - value to set
    • withUtype

      public ForeignKey withUtype(String pUtype)
      fluent setter for utype Attribute.
      Parameters:
      pUtype - value to set
      Returns:
      ForeignKey
    • getColumns

      public List<FKColumn> getColumns()
      Returns columns composition as an immutable list.
      Returns:
      columns composition.
    • setColumns

      public void setColumns(List<FKColumn> pColumns)
      Defines whole columns composition.
      Parameters:
      pColumns - composition to set.
    • addToColumns

      public void addToColumns(FKColumn p)
      Add a org.ivoa.dm.tapschema.FKColumn to the composition.
      Parameters:
      p - org.ivoa.dm.tapschema.FKColumn to add
    • removeFromColumns

      public void removeFromColumns(FKColumn p)
      Remove a org.ivoa.dm.tapschema.FKColumn from the composition.
      Parameters:
      p - org.ivoa.dm.tapschema.FKColumn to remove
    • replaceInColumns

      public void replaceInColumns(FKColumn _p)
      update a org.ivoa.dm.tapschema.FKColumn in the composition.
      Parameters:
      _p - org.ivoa.dm.tapschema.FKColumn to update the match is done via the database key
    • getId

      public String getId()
      return the database key id. Note that this is the same as attribute key_id.
      Specified by:
      getId in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
      Returns:
      the id
    • createForeignKey

      public static ForeignKey createForeignKey(Consumer<ForeignKey.ForeignKeyBuilder> f)
      create a ForeignKey in functional builder style.
      Parameters:
      f - the functional builder.
      Returns:
      an object initialized from the builder.
    • forceLoad

      public void forceLoad()
      Specified by:
      forceLoad in interface org.ivoa.vodml.jpa.JPAManipulations
    • delete

      public void delete(jakarta.persistence.EntityManager em)
      Specified by:
      delete in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>