All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openprovenance.prov.sql.WasAssociatedWith Maven / Gradle / Ivy

Go to download

Java Objects representing the PROV model, XML serialiser/deserialiser for them, and ORM mapping generated by HyperJaxb.

The newest version!
package org.openprovenance.prov.sql;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import org.openprovenance.prov.xml.builder.Equals;
import org.openprovenance.prov.xml.builder.HashCode;
import org.openprovenance.prov.xml.builder.ToString;
import org.openprovenance.prov.xml.builder.JAXBEqualsBuilder;
import org.openprovenance.prov.xml.builder.JAXBHashCodeBuilder;
import org.openprovenance.prov.xml.builder.JAXBToStringBuilder;
import org.openprovenance.apache.commons.lang.builder.EqualsBuilder;
import org.openprovenance.apache.commons.lang.builder.HashCodeBuilder;
import org.openprovenance.apache.commons.lang.builder.ToStringBuilder;
import org.openprovenance.prov.model.Attribute;
import org.openprovenance.prov.model.Other;
import org.openprovenance.prov.model.QualifiedName;
import org.openprovenance.prov.xml.AttributeList;
import org.openprovenance.prov.xml.HasAllAttributes;
import org.openprovenance.prov.xml.SortedAttributeList;


/**
 * 

Java class for Association complex type. * *

The following schema fragment specifies the expected content contained within this class. * *

 * <complexType name="Association">
 *   <complexContent>
 *     <extension base="{http://www.w3.org/ns/prov#}AStatement">
 *       <sequence>
 *         <element name="activity" type="{http://www.w3.org/ns/prov#}IDRef"/>
 *         <element name="agent" type="{http://www.w3.org/ns/prov#}IDRef" minOccurs="0"/>
 *         <element name="plan" type="{http://www.w3.org/ns/prov#}IDRef" minOccurs="0"/>
 *         <element ref="{http://www.w3.org/ns/prov#}label" maxOccurs="unbounded" minOccurs="0"/>
 *         <element ref="{http://www.w3.org/ns/prov#}role" maxOccurs="unbounded" minOccurs="0"/>
 *         <element ref="{http://www.w3.org/ns/prov#}type" maxOccurs="unbounded" minOccurs="0"/>
 *         <element ref="{http://www.w3.org/ns/prov#}others" maxOccurs="unbounded" minOccurs="0"/>
 *         <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *       <attribute ref="{http://www.w3.org/ns/prov#}id"/>
 *     </extension>
 *   </complexContent>
 * </complexType>
 * 
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Association", propOrder = { "activity", "agent", "plan", "label", // "role", // "type", // "others", // "any" "all" }) @Entity(name = "WasAssociatedWith") @Table(name = "WASASSOCIATEDWITH") public class WasAssociatedWith extends AStatement implements Equals, HashCode, ToString, org.openprovenance.prov.model.WasAssociatedWith, HasAllAttributes { @XmlElement(required = true, type = org.openprovenance.prov.sql.IDRef.class) protected org.openprovenance.prov.model.QualifiedName activity; @XmlElement(type = org.openprovenance.prov.sql.IDRef.class) protected org.openprovenance.prov.model.QualifiedName agent; @XmlElement(type = org.openprovenance.prov.sql.IDRef.class) protected org.openprovenance.prov.model.QualifiedName plan; @XmlElement(type = org.openprovenance.prov.sql.InternationalizedString.class) protected List label; transient protected List role; transient protected List type; transient protected List other; @XmlAnyElement protected List all; @javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(QualifiedNameAdapter.class) @XmlAttribute(name = "id", namespace = "http://www.w3.org/ns/prov#") protected QualifiedName id; /** * Gets the value of the activity property. * * @return * possible object is * {@link org.openprovenance.prov.sql.IDRef } * */ @ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "ACTIVITY") public org.openprovenance.prov.model.QualifiedName getActivity() { return activity; } /** * Sets the value of the activity property. * * @param value * allowed object is * {@link org.openprovenance.prov.sql.IDRef } * */ public void setActivity(org.openprovenance.prov.model.QualifiedName value) { this.activity = value; } /** * Gets the value of the agent property. * * @return * possible object is * {@link org.openprovenance.prov.sql.IDRef } * */ @ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "AGENT") public org.openprovenance.prov.model.QualifiedName getAgent() { return agent; } /** * Sets the value of the agent property. * * @param value * allowed object is * {@link org.openprovenance.prov.sql.IDRef } * */ public void setAgent(org.openprovenance.prov.model.QualifiedName value) { this.agent = value; } /** * Gets the value of the plan property. * * @return * possible object is * {@link org.openprovenance.prov.sql.IDRef } * */ @ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "PLAN") public org.openprovenance.prov.model.QualifiedName getPlan() { return plan; } /** * Sets the value of the plan property. * * @param value * allowed object is * {@link org.openprovenance.prov.sql.IDRef } * */ public void setPlan(org.openprovenance.prov.model.QualifiedName value) { this.plan = value; } /** * Gets the value of the label property. * *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a set method for the label property. * *

* For example, to add a new item, do as follows: *

     *    getLabel().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link org.openprovenance.prov.sql.InternationalizedString } * * */ @OneToMany(targetEntity = org.openprovenance.prov.sql.InternationalizedString.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "LABEL_WASASSOCIATEDWITH_PK") public List getLabel() { if (label == null) { label = new ArrayList(); } return this.label; } /** * * */ public void setLabel(List label) { this.label = label; } /** * Gets the value of the role property. * *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a set method for the role property. * *

* For example, to add a new item, do as follows: *

     *    getRole().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link org.openprovenance.prov.sql.Role } * * */ @OneToMany(targetEntity = org.openprovenance.prov.sql.Role.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "ROLE__WASASSOCIATEDWITH_PK") public List getRole() { if (role == null) { role=AttributeList.populateKnownAttributes(this,all, org.openprovenance.prov.model.Role.class); } return this.role; } /** * * */ public void setRole(List role) { this.role = role; } /** * Gets the value of the type property. * *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a set method for the type property. * *

* For example, to add a new item, do as follows: *

     *    getType().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link org.openprovenance.prov.sql.Type } * * */ @OneToMany(targetEntity = org.openprovenance.prov.sql.Type.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "TYPE__WASASSOCIATEDWITH_PK") public List getType() { if (type == null) { type=AttributeList.populateKnownAttributes(this,all, org.openprovenance.prov.model.Type.class); } return this.type; } /** * * */ public void setType(List type) { this.type = type; } /** * Gets the value of the others property. * *

* This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a set method for the others property. * *

* For example, to add a new item, do as follows: *

     *    getOthers().add(newItem);
     * 
* * *

* Objects of the following type(s) are allowed in the list * {@link Other } * * */ @OneToMany(targetEntity = org.openprovenance.prov.sql.Other.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "OTHERS_WASASSOCIATEDWITH_PK") public List getOther() { if (other == null) { other=AttributeList.populateKnownAttributes(this,all, org.openprovenance.prov.model.Other.class); } return this.other; } /** * * */ public void setOther(List others) { this.other = others; } /** * Gets the value of the id property. * * @return * possible object is * {@link QualifiedName } * */ @ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = { CascadeType.ALL }) @JoinColumn(name = "ID") public QualifiedName getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link QualifiedName } * */ public void setId(QualifiedName value) { this.id = value; } /** Gets the List of all attributes * @see org.openprovenance.prov.xml.HasAllAttributes#getAllAttributes() */ @Transient public List getAllAttributes() { if (all == null) { all = new SortedAttributeList(); } return this.all; } public void equals(Object object, EqualsBuilder equalsBuilder) { if (!(object instanceof WasAssociatedWith)) { equalsBuilder.appendSuper(false); return ; } if (this == object) { return ; } final WasAssociatedWith that = ((WasAssociatedWith) object); equalsBuilder.append(this.getActivity(), that.getActivity()); equalsBuilder.append(this.getAgent(), that.getAgent()); equalsBuilder.append(this.getPlan(), that.getPlan()); equalsBuilder.append(this.getLabel(), that.getLabel()); equalsBuilder.append(this.getRole(), that.getRole()); equalsBuilder.append(this.getType(), that.getType()); equalsBuilder.append(this.getOther(), that.getOther()); equalsBuilder.append(this.getId(), that.getId()); } public boolean equals(Object object) { if (!(object instanceof WasAssociatedWith)) { return false; } if (this == object) { return true; } final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder(); equals(object, equalsBuilder); return equalsBuilder.isEquals(); } public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getActivity()); hashCodeBuilder.append(this.getAgent()); hashCodeBuilder.append(this.getPlan()); hashCodeBuilder.append(this.getLabel()); hashCodeBuilder.append(this.getRole()); hashCodeBuilder.append(this.getType()); hashCodeBuilder.append(this.getOther()); hashCodeBuilder.append(this.getId()); } public int hashCode() { final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder(); hashCode(hashCodeBuilder); return hashCodeBuilder.toHashCode(); } public void toString(ToStringBuilder toStringBuilder) { { org.openprovenance.prov.model.QualifiedName theActivity; theActivity = this.getActivity(); toStringBuilder.append("activity", theActivity); } { org.openprovenance.prov.model.QualifiedName theAgent; theAgent = this.getAgent(); toStringBuilder.append("agent", theAgent); } { org.openprovenance.prov.model.QualifiedName thePlan; thePlan = this.getPlan(); toStringBuilder.append("plan", thePlan); } { List theLabel; theLabel = this.getLabel(); toStringBuilder.append("label", theLabel); } { List theRole; theRole = this.getRole(); toStringBuilder.append("role", theRole); } { List theType; theType = this.getType(); toStringBuilder.append("type", theType); } { List theOthers; theOthers = this.getOther(); toStringBuilder.append("others", theOthers); } { org.openprovenance.prov.model.QualifiedName theId; theId = this.getId(); toStringBuilder.append("id", theId); } } public String toString() { final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this); toString(toStringBuilder); return toStringBuilder.toString(); } @Transient public Kind getKind() { return org.openprovenance.prov.model.StatementOrBundle.Kind.PROV_ASSOCIATION; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy