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 class
A builder class for table, mainly for use in the functional builder pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionthe columns that make up the table.protected String
description.protected List<ForeignKey>
the foreign keys for this table.protected Integer
used to recommend table ordering for clients.protected String
name of the table.protected TableType
the type of table.protected String
utype. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a org.ivoa.dm.tapschema.Column to the composition.void
Add a org.ivoa.dm.tapschema.ForeignKey to the composition.static Table
create a table in functional builder style.void
delete
(jakarta.persistence.EntityManager em) void
Returns 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()
boolean
void
Remove a org.ivoa.dm.tapschema.Column from the composition.void
Remove a org.ivoa.dm.tapschema.ForeignKey from the composition.void
update a org.ivoa.dm.tapschema.Column in the composition.void
update a org.ivoa.dm.tapschema.ForeignKey in the composition.void
setColumns
(List<Column> pColumns) Defines whole columns composition.void
setDescription
(String pDescription) Set description Attribute.void
setFkeys
(List<ForeignKey> pFkeys) Defines whole fkeys composition.void
setTable_index
(Integer pTable_index) Set table_index Attribute.void
setTable_name
(String pTable_name) Set table_name Attribute.void
setTable_type
(TableType pTable_type) Set table_type Attribute.void
Set utype Attribute.void
void
updates any cloned references that are contained within the hierarchy.void
updateUsing
(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
-
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:
getXmlId
in interfaceorg.ivoa.vodml.jaxb.XmlIdManagement
-
setXmlId
- Specified by:
setXmlId
in interfaceorg.ivoa.vodml.jaxb.XmlIdManagement
-
hasNaturalKey
public boolean hasNaturalKey()- Specified by:
hasNaturalKey
in interfaceorg.ivoa.vodml.jaxb.XmlIdManagement
-
getId
return the database key id. Note that this is the same as attribute table_name.- Specified by:
getId
in 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:
forceLoad
in interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
delete
public void delete(jakarta.persistence.EntityManager em) - Specified by:
delete
in interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
-