Class Table

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

@Entity @VoDml(id="tapschema:table", role=objectType) public class Table extends Object implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>, org.ivoa.vodml.jaxb.XmlIdManagement
The table.

objectType: Table

  • Field Details

    • table_name

      @VoDml(id="tapschema:table.table_name", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String table_name
      name of the table. : Attribute table_name : multiplicity 1
    • table_type

      @VoDml(id="tapschema:table.table_type", role=attribute, type="tapschema:TableType", typeRole=enumeration) protected TableType table_type
      the type of table. : Attribute table_type : multiplicity 1
    • utype

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

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

      @VoDml(id="tapschema:table.table_index", role=attribute, type="ivoa:integer", typeRole=primitiveType) protected Integer table_index
      used to recommend table ordering for clients. Clients may order by index (ascending) so lower index items would appear earlier in a listing. : Attribute table_index : multiplicity 0..1
    • columns

      @VoDml(id="tapschema:table.columns", role=composition, type="tapschema:column", typeRole=objectType) protected List<Column> columns
      the columns that make up the table. composition columns : ( Multiplicity : 1..* )
    • fkeys

      @VoDml(id="tapschema:table.fkeys", role=composition, type="tapschema:ForeignKey", typeRole=objectType) protected List<ForeignKey> fkeys
      the foreign keys for this table. composition fkeys : ( Multiplicity : 0..* )
  • Constructor Details

    • Table

      public Table()
      Creates a new table
    • Table

      public Table(String table_name, TableType table_type, String utype, String description, Integer table_index, List<Column> columns, List<ForeignKey> fkeys)
      full parameter constructor.
      Parameters:
      table_name - name of the table.
      table_type - the type of table.
      utype - utype.
      description - description.
      table_index - used to recommend table ordering for clients. Clients may order by index (ascending) so lower index items would appear earlier in a listing.
      columns - the columns that make up the table.
      fkeys - the foreign keys for this table.
    • Table

      public Table(Table 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(Table 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.
    • getTable_name

      public String getTable_name()
      Returns table_name Attribute.
      Returns:
      table_name Attribute
    • setTable_name

      public void setTable_name(String pTable_name)
      Set table_name Attribute.
      Parameters:
      pTable_name - value to set
    • withTable_name

      public Table withTable_name(String pTable_name)
      fluent setter for table_name Attribute.
      Parameters:
      pTable_name - value to set
      Returns:
      table
    • getTable_type

      public TableType getTable_type()
      Returns table_type Attribute.
      Returns:
      table_type Attribute
    • setTable_type

      public void setTable_type(TableType pTable_type)
      Set table_type Attribute.
      Parameters:
      pTable_type - value to set
    • withTable_type

      public Table withTable_type(TableType pTable_type)
      fluent setter for table_type Attribute.
      Parameters:
      pTable_type - value to set
      Returns:
      table
    • 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 Table withUtype(String pUtype)
      fluent setter for utype Attribute.
      Parameters:
      pUtype - value to set
      Returns:
      table
    • 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 Table withDescription(String pDescription)
      fluent setter for description Attribute.
      Parameters:
      pDescription - value to set
      Returns:
      table
    • getTable_index

      public Integer getTable_index()
      Returns table_index Attribute.
      Returns:
      table_index Attribute
    • setTable_index

      public void setTable_index(Integer pTable_index)
      Set table_index Attribute.
      Parameters:
      pTable_index - value to set
    • withTable_index

      public Table withTable_index(Integer pTable_index)
      fluent setter for table_index Attribute.
      Parameters:
      pTable_index - value to set
      Returns:
      table
    • getColumns

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

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

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

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

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

      public List<ForeignKey> getFkeys()
      Returns fkeys composition as an immutable list.
      Returns:
      fkeys composition.
    • setFkeys

      public void setFkeys(List<ForeignKey> pFkeys)
      Defines whole fkeys composition.
      Parameters:
      pFkeys - composition to set.
    • addToFkeys

      public void addToFkeys(ForeignKey p)
      Add a org.ivoa.dm.tapschema.ForeignKey to the composition.
      Parameters:
      p - org.ivoa.dm.tapschema.ForeignKey to add
    • removeFromFkeys

      public void removeFromFkeys(ForeignKey p)
      Remove a org.ivoa.dm.tapschema.ForeignKey from the composition.
      Parameters:
      p - org.ivoa.dm.tapschema.ForeignKey to remove
    • replaceInFkeys

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

      public String getXmlId()
      Specified by:
      getXmlId in interface org.ivoa.vodml.jaxb.XmlIdManagement
    • setXmlId

      public void setXmlId(String id)
      Specified by:
      setXmlId in interface org.ivoa.vodml.jaxb.XmlIdManagement
    • hasNaturalKey

      public boolean hasNaturalKey()
      Specified by:
      hasNaturalKey in interface org.ivoa.vodml.jaxb.XmlIdManagement
    • getId

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

      public static Table createTable(Consumer<Table.TableBuilder> f)
      create a table 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>