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
  • Field Details

    • _id

      protected Long _id
      inserted database key
    • relationshipType

      @VoDml(id="VOResource:Relationship.relationshipType", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String 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. : Attribute relationshipType : multiplicity 1
    • relatedResource

      @VoDml(id="VOResource:Relationship.relatedResource", role=attribute, type="VOResource:ResourceName", typeRole=dataType) protected List<ResourceName> relatedResource
      the name of resource that this resource is related to. : Attribute relatedResource : multiplicity 1..*
  • Constructor Details

    • Relationship

      public Relationship()
      Creates a new Relationship
    • Relationship

      public Relationship(String relationshipType, List<ResourceName> relatedResource)
      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

      public Relationship(Relationship other)
      Copy Constructor. Note that references will remain as is rather than be copied.
      Parameters:
      other - the object to be copied.
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
      Returns:
      the id
    • updateUsing

      public void updateUsing(Relationship other)
      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

      public String getRelationshipType()
      Returns relationshipType Attribute.
      Returns:
      relationshipType Attribute
    • setRelationshipType

      public void setRelationshipType(String pRelationshipType)
      Set relationshipType Attribute.
      Parameters:
      pRelationshipType - value to set
    • withRelationshipType

      public Relationship withRelationshipType(String pRelationshipType)
      fluent setter for relationshipType Attribute.
      Parameters:
      pRelationshipType - value to set
      Returns:
      Relationship
    • getRelatedResource

      public List<ResourceName> getRelatedResource()
      Returns relatedResource Attribute.
      Returns:
      relatedResource Attribute
    • setRelatedResource

      public void setRelatedResource(List<ResourceName> pRelatedResource)
      Set relatedResource Attribute.
      Parameters:
      pRelatedResource - value to set
    • withRelatedResource

      public Relationship withRelatedResource(List<ResourceName> pRelatedResource)
      fluent setter for relatedResource Attribute.
      Parameters:
      pRelatedResource - value to set
      Returns:
      Relationship
    • createRelationship

      public static Relationship createRelationship(Consumer<Relationship.RelationshipBuilder> f)
      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:
      forceLoad in interface org.ivoa.vodml.jpa.JPAManipulations
    • delete

      public void delete(jakarta.persistence.EntityManager em)
      Specified by:
      delete in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>