Package org.ivoa.dm.tapschema
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for ForeignKey, mainly for use in the functional builder pattern. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ForeignKeyForeignKey(String key_id, Table target_table, String description, String utype, List<FKColumn> columns) full parameter constructor.ForeignKey(ForeignKey other) Copy Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a org.ivoa.dm.tapschema.FKColumn to the composition.static ForeignKeycreate a ForeignKey in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidReturns columns composition as an immutable list.Returns description Attribute.getId()return the database key id.Returns key_id Attribute.Returns target_table ReferencegetUtype()Returns utype Attribute.voidRemove a org.ivoa.dm.tapschema.FKColumn from the composition.voidupdate a org.ivoa.dm.tapschema.FKColumn in the composition.voidsetColumns(List<FKColumn> pColumns) Defines whole columns composition.voidsetDescription(String pDescription) Set description Attribute.voidSet key_id Attribute.voidsetTarget_table(Table pTarget_table) Defines target_table ReferencevoidSet utype Attribute.voidupdates any cloned references that are contained within the hierarchy.voidupdateUsing(ForeignKey other) Update this object with the content of the given object.withDescription(String pDescription) fluent setter for description Attribute.withKey_id(String pKey_id) fluent setter for key_id Attribute.fluent setter for utype Attribute.
-
Field Details
-
key_id
@VoDml(id="tapschema:ForeignKey.key_id", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String key_idthe 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_tableReferenceObject target_table : the target table of the foreign key. ( Multiplicity : 1 ) -
description
@VoDml(id="tapschema:ForeignKey.description", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String descriptiondescription. : Attribute description : multiplicity 0..1 -
utype
@VoDml(id="tapschema:ForeignKey.utype", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String utypeutype. : Attribute utype : multiplicity 0..1 -
columns
@VoDml(id="tapschema:ForeignKey.columns", role=composition, type="tapschema:FKColumn", typeRole=objectType) protected List<FKColumn> columnsThe columns that make up the foreign key. 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- the target table of the foreign key.description- description.utype- utype.columns- The columns that make up the foreign key.
-
ForeignKey
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.
-
getKey_id
Returns key_id Attribute.- Returns:
- key_id Attribute
-
setKey_id
Set key_id Attribute.- Parameters:
pKey_id- value to set
-
withKey_id
fluent setter for key_id Attribute.- Parameters:
pKey_id- value to set- Returns:
- ForeignKey
-
getTarget_table
Returns target_table Reference- Returns:
- target_table Reference
-
setTarget_table
Defines target_table Reference- Parameters:
pTarget_table- reference to set
-
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:
- ForeignKey
-
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:
- ForeignKey
-
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.FKColumn to the composition.- Parameters:
p- org.ivoa.dm.tapschema.FKColumn to add
-
removeFromColumns
Remove a org.ivoa.dm.tapschema.FKColumn from the composition.- Parameters:
p- org.ivoa.dm.tapschema.FKColumn to remove
-
replaceInColumns
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
return the database key id. Note that this is the same as attribute key_id.- Specified by:
getIdin interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>- Returns:
- the id
-
createForeignKey
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:
forceLoadin interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
delete
public void delete(jakarta.persistence.EntityManager em) - Specified by:
deletein interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
-