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 class
A 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 TypeMethodDescriptionvoid
Add a org.ivoa.dm.tapschema.FKColumn to the composition.static ForeignKey
create a ForeignKey in functional builder style.void
delete
(jakarta.persistence.EntityManager em) void
Returns 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.void
Remove a org.ivoa.dm.tapschema.FKColumn from the composition.void
update a org.ivoa.dm.tapschema.FKColumn in the composition.void
setColumns
(List<FKColumn> pColumns) Defines whole columns composition.void
setDescription
(String pDescription) Set description Attribute.void
Set key_id Attribute.void
setTarget_table
(Table pTarget_table) Defines target_table Referencevoid
Set utype Attribute.void
updates any cloned references that are contained within the hierarchy.void
updateUsing
(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 : . ( 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> columns. 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
- .description
- description.utype
- utype.columns
- .
-
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:
getId
in 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:
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>
-