Package org.ivoa.dm.registry.voresource
Class Relationship
java.lang.Object
org.ivoa.dm.registry.voresource.Relationship
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
@Entity
@VoDml(id="VOResource:Relationship",
role=objectType)
public class Relationship
extends Object
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A description of the relationship between one resource and one or
more other resources.
objectType: Relationship
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for Relationship, mainly for use in the functional builder pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Longinserted database keyprotected List<ResourceName>the name of resource that this resource is related to.protected Stringthe named type of relationship The value of relationshipType should be taken from the vocabulary at http://www.ivoa.net/rdf/voresource/relationship_type. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new RelationshipRelationship(String relationshipType, List<ResourceName> relatedResource) full parameter constructor.Relationship(Relationship other) Copy Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic Relationshipcreate a Relationship in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidgetId()Returns relatedResource Attribute.Returns relationshipType Attribute.voidsetRelatedResource(List<ResourceName> pRelatedResource) Set relatedResource Attribute.voidsetRelationshipType(String pRelationshipType) Set relationshipType Attribute.voidupdateUsing(Relationship other) Update this object with the content of the given object.withRelatedResource(List<ResourceName> pRelatedResource) fluent setter for relatedResource Attribute.withRelationshipType(String pRelationshipType) fluent setter for relationshipType Attribute.
-
Field Details
-
_id
inserted database key -
relationshipType
@VoDml(id="VOResource:Relationship.relationshipType", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String relationshipTypethe named type of relationship The value of relationshipType should be taken from the vocabulary at http://www.ivoa.net/rdf/voresource/relationship_type. : Attribute relationshipType : multiplicity 1
-
-
Constructor Details
-
Relationship
public Relationship()Creates a new Relationship -
Relationship
full parameter constructor.- Parameters:
relationshipType- the named type of relationship The value of relationshipType should be taken from the vocabulary at http://www.ivoa.net/rdf/voresource/relationship_type.relatedResource- the name of resource that this resource is related to.
-
Relationship
Copy Constructor. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>- Returns:
- the id
-
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.
-
getRelationshipType
Returns relationshipType Attribute.- Returns:
- relationshipType Attribute
-
setRelationshipType
Set relationshipType Attribute.- Parameters:
pRelationshipType- value to set
-
withRelationshipType
fluent setter for relationshipType Attribute.- Parameters:
pRelationshipType- value to set- Returns:
- Relationship
-
getRelatedResource
Returns relatedResource Attribute.- Returns:
- relatedResource Attribute
-
setRelatedResource
Set relatedResource Attribute.- Parameters:
pRelatedResource- value to set
-
withRelatedResource
fluent setter for relatedResource Attribute.- Parameters:
pRelatedResource- value to set- Returns:
- Relationship
-
createRelationship
create a Relationship 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<Long>
-