Package org.ivoa.dm.tapschema
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classComposite key for Table.static classA builder class for table, mainly for use in the functional builder pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionthe columns that make up the table.protected Stringdescription.protected List<ForeignKey>the foreign keys for this table.protected Stringadditional key to parent of composition(s).protected Integerused to recommend table ordering for clients.protected Stringname of the table.protected TableTypethe type of table.protected Stringutype. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a org.ivoa.dm.tapschema.Column to the composition.voidAdd a org.ivoa.dm.tapschema.ForeignKey to the composition.static Tablecreate a table in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidReturns columns composition as an immutable list.Returns description Attribute.getFkeys()Returns fkeys composition as an immutable list.getId()return the database key id.Returns table_index Attribute.Returns table_name Attribute.Returns table_type Attribute.getUtype()Returns utype Attribute.getXmlId()booleanvoidRemove a org.ivoa.dm.tapschema.Column from the composition.voidRemove a org.ivoa.dm.tapschema.ForeignKey from the composition.voidupdate a org.ivoa.dm.tapschema.Column in the composition.voidupdate a org.ivoa.dm.tapschema.ForeignKey in the composition.voidsetColumns(List<Column> pColumns) Defines whole columns composition.voidsetDescription(String pDescription) Set description Attribute.voidsetFkeys(List<ForeignKey> pFkeys) Defines whole fkeys composition.voidsetTable_index(Integer pTable_index) Set table_index Attribute.voidsetTable_name(String pTable_name) Set table_name Attribute.voidsetTable_type(TableType pTable_type) Set table_type Attribute.voidSet utype Attribute.voidvoidupdates any cloned references that are contained within the hierarchy.voidupdateUsing(Table other) Update this object with the content of the given object.withDescription(String pDescription) fluent setter for description Attribute.withTable_index(Integer pTable_index) fluent setter for table_index Attribute.withTable_name(String pTable_name) fluent setter for table_name Attribute.withTable_type(TableType pTable_type) fluent setter for table_type Attribute.fluent setter for utype Attribute.
-
Field Details
-
schema_name
additional key to parent of composition(s). -
table_name
@VoDml(id="tapschema:table.table_name", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String table_namename 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_typethe type of table. : Attribute table_type : multiplicity 1 -
utype
@VoDml(id="tapschema:table.utype", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String utypeutype. : Attribute utype : multiplicity 0..1 -
description
@VoDml(id="tapschema:table.description", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String descriptiondescription. : Attribute description : multiplicity 0..1 -
table_index
@VoDml(id="tapschema:table.table_index", role=attribute, type="ivoa:integer", typeRole=primitiveType) protected Integer table_indexused 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> columnsthe 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> fkeysthe 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
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
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
Returns table_name Attribute.- Returns:
- table_name Attribute
-
setTable_name
Set table_name Attribute.- Parameters:
pTable_name- value to set
-
withTable_name
fluent setter for table_name Attribute.- Parameters:
pTable_name- value to set- Returns:
- table
-
getTable_type
Returns table_type Attribute.- Returns:
- table_type Attribute
-
setTable_type
Set table_type Attribute.- Parameters:
pTable_type- value to set
-
withTable_type
fluent setter for table_type Attribute.- Parameters:
pTable_type- value to set- Returns:
- table
-
getUtype
Returns utype Attribute.- Returns:
- utype Attribute
-
setUtype
Set utype Attribute.- Parameters:
pUtype- value to set
-
withUtype
fluent setter for utype Attribute.- Parameters:
pUtype- value to set- Returns:
- table
-
getDescription
Returns description Attribute.- Returns:
- description Attribute
-
setDescription
Set description Attribute.- Parameters:
pDescription- value to set
-
withDescription
fluent setter for description Attribute.- Parameters:
pDescription- value to set- Returns:
- table
-
getTable_index
Returns table_index Attribute.- Returns:
- table_index Attribute
-
setTable_index
Set table_index Attribute.- Parameters:
pTable_index- value to set
-
withTable_index
fluent setter for table_index Attribute.- Parameters:
pTable_index- value to set- Returns:
- table
-
getColumns
Returns columns composition as an immutable list.- Returns:
- columns composition.
-
setColumns
Defines whole columns composition.- Parameters:
pColumns- composition to set.
-
addToColumns
Add a org.ivoa.dm.tapschema.Column to the composition.- Parameters:
p- org.ivoa.dm.tapschema.Column to add
-
removeFromColumns
Remove a org.ivoa.dm.tapschema.Column from the composition.- Parameters:
p- org.ivoa.dm.tapschema.Column to remove
-
replaceInColumns
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
Returns fkeys composition as an immutable list.- Returns:
- fkeys composition.
-
setFkeys
Defines whole fkeys composition.- Parameters:
pFkeys- composition to set.
-
addToFkeys
Add a org.ivoa.dm.tapschema.ForeignKey to the composition.- Parameters:
p- org.ivoa.dm.tapschema.ForeignKey to add
-
removeFromFkeys
Remove a org.ivoa.dm.tapschema.ForeignKey from the composition.- Parameters:
p- org.ivoa.dm.tapschema.ForeignKey to remove
-
replaceInFkeys
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
- Specified by:
getXmlIdin interfaceorg.ivoa.vodml.jaxb.XmlIdManagement
-
setXmlId
- Specified by:
setXmlIdin interfaceorg.ivoa.vodml.jaxb.XmlIdManagement
-
hasNaturalKey
public boolean hasNaturalKey()- Specified by:
hasNaturalKeyin interfaceorg.ivoa.vodml.jaxb.XmlIdManagement
-
getId
return the database key id. Note that this is the same as attribute table_name.- Specified by:
getIdin interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>- Returns:
- the id
-
createTable
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:
forceLoadin interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
delete
public void delete(jakarta.persistence.EntityManager em) - Specified by:
deletein interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
-