/** * Returns a cloned version of the current object. * * @return a cloned version of the current Experiment with following exceptions. <ul> <li>Interactions are not * cloned. The interactions for the cloned experiment is empty</li> <li>New components but with the same * proteins. The new components has the cloned interaction as their interaction.</li> </ul> * * @throws CloneNotSupportedException */ @Override public Object clone() throws CloneNotSupportedException { Experiment copy = ( Experiment ) super.clone(); // Not copying any interactions. copy.interactions = new ArrayList<Interaction>(); return copy; }
@Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( !( o instanceof Publication )) { return false; } if ( !super.equals( o ) ) { return false; } // shouldn't we be relying on the Xrefs solely ?? // annotated object's equals relies on shortlabel, fullname and xrefs !! // one publication Xref in common should be enough ! either pmid, doi as primary-reference return true; }
@ManyToMany( cascade = {CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE, CascadeType.REFRESH, CascadeType.DETACH} ) @JoinTable( name = "ia_pub2annot", joinColumns = {@JoinColumn( name = "publication_ac" )}, inverseJoinColumns = {@JoinColumn( name = "annotation_ac" )} ) @Override public Collection<Annotation> getAnnotations() { return super.getAnnotations(); }
@OneToMany( mappedBy = "parent", orphanRemoval = true ) @Cascade( value = {org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.MERGE, org.hibernate.annotations.CascadeType.REFRESH, org.hibernate.annotations.CascadeType.DETACH} ) @Override public Collection<InteractorXref> getXrefs() { return super.getXrefs(); }
@OneToMany( mappedBy = "parent", orphanRemoval = true) @Cascade( value = {org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.MERGE, org.hibernate.annotations.CascadeType.REFRESH, org.hibernate.annotations.CascadeType.DETACH} ) @Override public Collection<InteractorAlias> getAliases() { return super.getAliases(); }
@Override public int hashCode() { return 29 * super.hashCode(); } }
/** * Constructor for subclass use only. Ensures that AnnotatedObjects cannot be * created without at least a shortLabel and an owner specified. * * @param shortLabel The memorable label to identify this AnnotatedObject * @param owner The Institution which owns this AnnotatedObject * * @throws NullPointerException thrown if either parameters are not specified */ protected OwnedAnnotatedObject( String shortLabel, Institution owner ) { //super call sets creation time data super(shortLabel); setOwner( owner ); }
@Column(name="shortLabel", insertable = false, updatable = false) public String getPublicationId() { return super.getShortLabel(); }
@OneToMany( mappedBy = "parent" ) @Cascade( value = {org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.MERGE, org.hibernate.annotations.CascadeType.REFRESH, org.hibernate.annotations.CascadeType.DETACH} ) @Override public Collection<PublicationXref> getXrefs() { return super.getXrefs(); }
@OneToMany( mappedBy = "parent" ) @Cascade( value = {org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.MERGE, org.hibernate.annotations.CascadeType.REFRESH, org.hibernate.annotations.CascadeType.DETACH} ) @Override public Collection<PublicationAlias> getAliases() { return super.getAliases(); }
@Override public int hashCode() { return 29 * super.hashCode(); } }
/** * Constructor for subclass use only. Ensures that AnnotatedObjects cannot be * created without at least a shortLabel and an owner specified. * * @param shortLabel The memorable label to identify this AnnotatedObject * @param owner The Institution which owns this AnnotatedObject * * @throws NullPointerException thrown if either parameters are not specified */ protected OwnedAnnotatedObject( String shortLabel, Institution owner ) { //super call sets creation time data super(shortLabel); setOwner( owner ); }
@Column(name="shortLabel", insertable = false, updatable = false) public String getPublicationId() { return super.getShortLabel(); }
@OneToMany( mappedBy = "parent", orphanRemoval = true ) @Cascade( value = {org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.MERGE, org.hibernate.annotations.CascadeType.REFRESH, org.hibernate.annotations.CascadeType.DETACH} ) @Override public Collection<ExperimentXref> getXrefs() { return super.getXrefs(); }
@OneToMany( mappedBy = "parent", orphanRemoval = true ) @Cascade( value = {org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.MERGE, org.hibernate.annotations.CascadeType.REFRESH, org.hibernate.annotations.CascadeType.DETACH} ) @Override public Collection<ExperimentAlias> getAliases() { return super.getAliases(); }
@Override public int hashCode() { int result = super.hashCode(); result = 29 * result + ( bioSource != null ? bioSource.hashCode() : 0 ); result = 29 * result + ( interactorType != null ? interactorType.hashCode() : 0 ); // next line is commented because is making hibernate (cglib) fail from time to time //result = 29 * result + ( activeInstances != null ? activeInstances.size() : 0 ); return result; }
@ManyToMany( cascade = {CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE, CascadeType.REFRESH, CascadeType.DETACH} ) @JoinTable( name = "ia_pub2annot", joinColumns = {@JoinColumn( name = "publication_ac" )}, inverseJoinColumns = {@JoinColumn( name = "annotation_ac" )} ) @Override public Collection<Annotation> getAnnotations() { return super.getAnnotations(); }
@Override public boolean equals( Object o ) { if ( this == o ) { return true; } if ( !( o instanceof Publication )) { return false; } if ( !super.equals( o ) ) { return false; } // shouldn't we be relying on the Xrefs solely ?? // annotated object's equals relies on shortlabel, fullname and xrefs !! // one publication Xref in common should be enough ! either pmid, doi as primary-reference return true; }
/** * Returns a cloned version of the current object. * * @return a cloned version of the current Experiment with following exceptions. <ul> <li>Interactions are not * cloned. The interactions for the cloned experiment is empty</li> <li>New components but with the same * proteins. The new components has the cloned interaction as their interaction.</li> </ul> * * @throws CloneNotSupportedException */ @Override public Object clone() throws CloneNotSupportedException { Experiment copy = ( Experiment ) super.clone(); // Not copying any interactions. copy.interactions = new ArrayList<Interaction>(); return copy; }
@OneToMany( mappedBy = "parent" ) @Cascade( value = {org.hibernate.annotations.CascadeType.PERSIST, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.MERGE, org.hibernate.annotations.CascadeType.REFRESH, org.hibernate.annotations.CascadeType.DETACH} ) @Override public Collection<PublicationXref> getXrefs() { return super.getXrefs(); }