Class ForeignKey

java.lang.Object
org.ivoa.dm.registry.vodataservice.ForeignKey
All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations, org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>

@Entity @VoDml(id="VODataService:ForeignKey", role=objectType) public class ForeignKey extends Object implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A description of the mapping a foreign key -- a set of columns from one table -- to columns in another table. When foreign keys are declared in this way, clients can expect that joins constrained with the foreign keys are preformed efficiently (e.g., using an index). objectType: ForeignKey
  • Field Details

    • _id

      protected Long _id
      inserted database key
    • targetTable

      @VoDml(id="VODataService:ForeignKey.targetTable", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String targetTable
      The fully qualified name (including catalogue and schema, as applicable) of the table that can be joined with the table containing this foreign key. : Attribute targetTable : multiplicity 1
    • fkColumn

      @VoDml(id="VODataService:ForeignKey.fkColumn", role=composition, type="VODataService:FKColumn", typeRole=objectType) protected List<FKColumn> fkColumn
      A pair of column names, one from this table and one from the target table that should be used to join the tables in a query. composition fkColumn : ( Multiplicity : 1..* )
    • description

      @VoDml(id="VODataService:ForeignKey.description", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String description
      A free-text description of what this key points to and what the relationship means. : Attribute description : multiplicity 0..1
    • utype

      @VoDml(id="VODataService:ForeignKey.utype", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String utype
      An identifier for a concept in a data model that the association enabled by this key represents. The form of the utype string depends on the data model; common forms are sequences of dotted identifiers (e.g., in SSA) or URIs (e.g., in RegTAP). : Attribute utype : multiplicity 0..1
  • Constructor Details

    • ForeignKey

      public ForeignKey()
      Creates a new ForeignKey
    • ForeignKey

      public ForeignKey(String targetTable, List<FKColumn> fkColumn, String description, String utype)
      full parameter constructor.
      Parameters:
      targetTable - The fully qualified name (including catalogue and schema, as applicable) of the table that can be joined with the table containing this foreign key.
      fkColumn - A pair of column names, one from this table and one from the target table that should be used to join the tables in a query.
      description - A free-text description of what this key points to and what the relationship means.
      utype - An identifier for a concept in a data model that the association enabled by this key represents. The form of the utype string depends on the data model; common forms are sequences of dotted identifiers (e.g., in SSA) or URIs (e.g., in RegTAP).
    • 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

    • getId

      public Long getId()
      Specified by:
      getId in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
      Returns:
      the id
    • 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.
    • getTargetTable

      public String getTargetTable()
      Returns targetTable Attribute.
      Returns:
      targetTable Attribute
    • setTargetTable

      public void setTargetTable(String pTargetTable)
      Set targetTable Attribute.
      Parameters:
      pTargetTable - value to set
    • withTargetTable

      public ForeignKey withTargetTable(String pTargetTable)
      fluent setter for targetTable Attribute.
      Parameters:
      pTargetTable - value to set
      Returns:
      ForeignKey
    • getFkColumn

      public List<FKColumn> getFkColumn()
      Returns fkColumn composition as an immutable list.
      Returns:
      fkColumn composition.
    • setFkColumn

      public void setFkColumn(List<FKColumn> pFkColumn)
      Defines whole fkColumn composition.
      Parameters:
      pFkColumn - composition to set.
    • addToFkColumn

      public void addToFkColumn(FKColumn p)
      Add a org.ivoa.dm.registry.vodataservice.FKColumn to the composition.
      Parameters:
      p - org.ivoa.dm.registry.vodataservice.FKColumn to add
    • removeFromFkColumn

      public void removeFromFkColumn(FKColumn p)
      Remove a org.ivoa.dm.registry.vodataservice.FKColumn from the composition.
      Parameters:
      p - org.ivoa.dm.registry.vodataservice.FKColumn to remove
    • replaceInFkColumn

      public void replaceInFkColumn(FKColumn _p)
      update a org.ivoa.dm.registry.vodataservice.FKColumn in the composition.
      Parameters:
      _p - org.ivoa.dm.registry.vodataservice.FKColumn to update the match is done via the database key
    • 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
    • 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<Long>