From ba08dfd737bd5903d27038a941866dbbc5867ae3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20M=C3=BCller?= Date: Wed, 11 Sep 2013 14:31:18 +0000 Subject: [PATCH] final implementation of MaterialOrMethodEvent, Cloning, PreservationMethod, ... #3360 --- .gitattributes | 4 +- .../test/resources/dbscripts/001-cdm.h2.sql | 128 ++++------ .../test/resources/dbscripts/001-cdm.h2.sql | 128 ++++------ .../etaxonomy/cdm/io/jaxb/CdmImporterTest.xml | Bin 2817139 -> 2817139 bytes ...CdmPreferences.java => CdmPreference.java} | 18 +- .../etaxonomy/cdm/model/common/EventBase.java | 27 +- .../cdm/model/common/ISimpleTerm.java | 1 - .../cdm/model/common/MaterialAndMethod.java | 93 ------- .../etaxonomy/cdm/model/common/TermType.java | 24 +- .../cdm/model/common/VocabularyEnum.java | 5 +- .../description/DescriptionElementBase.java | 14 +- .../cdm/model/molecular/Amplification.java | 8 +- .../cdm/model/molecular/Cloning.java | 61 ++--- .../cdm/model/molecular/SingleRead.java | 18 +- .../occurrence/MaterialOrMethodEvent.java | 188 ++++++++++++++ .../model/occurrence/PreservationMethod.java | 238 ++++++++++-------- .../src/main/resources/terms/MarkerType.csv | 2 +- .../resources/terms/PreservationMethod.csv | 7 +- .../update/v31_33/SchemaUpdater_31_33.java | 69 +++-- .../hibernate/common/DefinedTermDaoImpl.java | 22 +- .../eu/etaxonomy/cdm/hibernate.cfg.xml | 6 +- .../dao/hibernate/common/DaoBaseTest.java | 1 - .../test/resources/dbscripts/001-cdm.h2.sql | 128 ++++------ .../TermsDataSet-with_auditing_info.xml | Bin 2553102 -> 2553102 bytes .../common/DefinedTermDaoImplTest.xml | Bin 2540580 -> 2540580 bytes .../DerivedUnitFacadeCacheStrategyTest.java | 2 +- ...dUnitFacadeFieldUnitCacheStrategyTest.java | 2 +- .../cdm/api/facade/DerivedUnitFacadeTest.java | 5 +- .../test/resources/dbscripts/001-cdm.h2.sql | 128 ++++------ 29 files changed, 646 insertions(+), 681 deletions(-) rename cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/{CdmPreferences.java => CdmPreference.java} (88%) delete mode 100644 cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MaterialAndMethod.java create mode 100644 cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/MaterialOrMethodEvent.java diff --git a/.gitattributes b/.gitattributes index 5b409fdd51..c8fa9563d7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -740,7 +740,7 @@ cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Annotation.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/AnnotationType.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/CdmBase.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/CdmMetaData.java -text -cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/CdmPreferences.java -text +cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/CdmPreference.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Credit.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/DefaultTermInitializer.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/DefinedTerm.java -text @@ -779,7 +779,6 @@ cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/LanguageString.java -te cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/LanguageStringBase.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/Marker.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MarkerType.java -text -cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MaterialAndMethod.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MultilanguageText.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MultilanguageTextHelper.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/NoDefinedTermClassException.java -text @@ -913,6 +912,7 @@ cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/DerivedUnit.java -t cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/DeterminationEvent.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/FieldUnit.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/GatheringEvent.java -text +cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/MaterialOrMethodEvent.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/MediaSpecimen.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java -text cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/SpecimenOrObservationBase.java -text diff --git a/cdmlib-ext/src/test/resources/dbscripts/001-cdm.h2.sql b/cdmlib-ext/src/test/resources/dbscripts/001-cdm.h2.sql index 89ed4af6a0..96ccbb9040 100644 --- a/cdmlib-ext/src/test/resources/dbscripts/001-cdm.h2.sql +++ b/cdmlib-ext/src/test/resources/dbscripts/001-cdm.h2.sql @@ -466,12 +466,12 @@ CREATE CACHED TABLE PUBLIC.CDMMETADATA( CREATEDBY_ID INTEGER ); -- 3 +/- SELECT COUNT(*) FROM PUBLIC.CDMMETADATA; -CREATE CACHED TABLE PUBLIC.CDMPREFERENCES( - SUBJECT VARCHAR(255), - PREDICATE VARCHAR(255), +CREATE CACHED TABLE PUBLIC.CDMPREFERENCE( + KEY_SUBJECT VARCHAR(100), + KEY_PREDICATE VARCHAR(100), VALUE VARCHAR(1023) ); --- 3 +/- SELECT COUNT(*) FROM PUBLIC.CDMMETADATA; +-- 3 +/- SELECT COUNT(*) FROM PUBLIC.CDMPREFERENCE; CREATE CACHED TABLE PUBLIC.CLASSIFICATION( ID INTEGER NOT NULL, CREATED TIMESTAMP, @@ -598,72 +598,6 @@ CREATE CACHED TABLE PUBLIC.CLASSIFICATION_TAXONNODE_AUD( REVTYPE TINYINT ); -CREATE TABLE PUBLIC.CLONING ( - ID INTEGER NOT NULL, - UUID VARCHAR(36), - CREATED TIMESTAMP, - UPDATED TIMESTAMP, - CREATEDBY_ID INTEGER, - UPDATEDBY_ID INTEGER, - DESCRIPTION VARCHAR(255), - TIMEPERIOD_END VARCHAR(255), - TIMEPERIOD_FREETEXT VARCHAR(255), - TIMEPERIOD_START VARCHAR(255), - STRAIN VARCHAR(255), - METHOD_ID INTEGER, - ACTOR_ID INTEGER, - FORWARDPRIMER_ID INTEGER, - REVERSEPRIMER_ID INTEGER, - PRIMARY KEY (ID) -); - -CREATE TABLE PUBLIC.CLONING_AUD ( - ID INTEGER NOT NULL, - REV INTEGER NOT NULL, - REVTYPE TINYINT, - CREATED TIMESTAMP, - UUID VARCHAR(36), - UPDATED TIMESTAMP, - DESCRIPTION VARCHAR(255), - TIMEPERIOD_END VARCHAR(255), - TIMEPERIOD_FREETEXT VARCHAR(255), - TIMEPERIOD_START VARCHAR(255), - METHOD_ID INTEGER, - STRAIN VARCHAR(255), - CREATEDBY_ID INTEGER, - UPDATEDBY_ID INTEGER, - ACTOR_ID INTEGER, - FORWARDPRIMER_ID INTEGER, - REVERSEPRIMER_ID INTEGER -); - - -CREATE TABLE PUBLIC.CLONING_ANNOTATION ( - CLONING_ID INTEGER NOT NULL, - ANNOTATIONS_ID INTEGER NOT NULL, - PRIMARY KEY (CLONING_ID, ANNOTATIONS_ID) -); - -CREATE TABLE PUBLIC.CLONING_ANNOTATION_AUD ( - REV INTEGER NOT NULL, - REVTYPE TINYINT, - CLONING_ID INTEGER NOT NULL, - ANNOTATIONS_ID INTEGER NOT NULL -); - -CREATE TABLE PUBLIC.CLONING_MARKER ( - CLONING_ID INTEGER NOT NULL, - MARKERS_ID INTEGER NOT NULL, - PRIMARY KEY (CLONING_ID, MARKERS_ID) -); - -CREATE TABLE PUBLIC.CLONING_MARKER_AUD ( - REV INTEGER NOT NULL, - REVTYPE TINYINT, - CLONING_ID INTEGER NOT NULL, - MARKERS_ID INTEGER NOT NULL -); - -- 0 +/- SELECT COUNT(*) FROM PUBLIC.CLASSIFICATION_TAXONNODE_AUD; CREATE CACHED TABLE PUBLIC.COLLECTION( ID INTEGER NOT NULL, @@ -2190,52 +2124,74 @@ CREATE CACHED TABLE PUBLIC.MARKER_AUD( MARKERTYPE_ID INTEGER ); -CREATE TABLE MATERIALANDMETHOD ( +CREATE TABLE MATERIALORMETHODEVENT ( ID INTEGER NOT NULL, + DTYPE VARCHAR(255), CREATED TIMESTAMP, UUID VARCHAR(36), UPDATED TIMESTAMP, - MATERIALMETHODTERM BINARY(255), MATERIALMETHODTEXT VARCHAR(255), + DESCRIPTION VARCHAR(255), + TIMEPERIOD_END VARCHAR(255), + TIMEPERIOD_FREETEXT VARCHAR(255), + TIMEPERIOD_START VARCHAR(255), + STRAIN VARCHAR(255), + TEMPERATURE DOUBLE, CREATEDBY_ID INTEGER, UPDATEDBY_ID INTEGER, + MATERIALMETHODTERM_ID INTEGER, + ACTOR_ID INTEGER, + FORWARDPRIMER_ID INTEGER, + REVERSEPRIMER_ID INTEGER, + MEDIUM_ID INTEGER, PRIMARY KEY (ID) ); -CREATE TABLE MATERIALANDMETHOD_AUD ( +CREATE TABLE MATERIALORMETHODEVENT_AUD ( ID INTEGER NOT NULL, + DTYPE VARCHAR(255), CREATED TIMESTAMP, UUID VARCHAR(36), UPDATED TIMESTAMP, - MATERIALMETHODTERM BINARY(255), MATERIALMETHODTEXT VARCHAR(255), + DESCRIPTION VARCHAR(255), + TIMEPERIOD_END VARCHAR(255), + TIMEPERIOD_FREETEXT VARCHAR(255), + TIMEPERIOD_START VARCHAR(255), + STRAIN VARCHAR(255), + TEMPERATURE DOUBLE, CREATEDBY_ID INTEGER, UPDATEDBY_ID INTEGER, + MATERIALMETHODTERM_ID INTEGER, + ACTOR_ID INTEGER, + FORWARDPRIMER_ID INTEGER, + REVERSEPRIMER_ID INTEGER, + MEDIUM_ID INTEGER ); -CREATE TABLE MATERIALANDMETHOD_ANNOTATION ( - MATERIALANDMETHOD_ID INTEGER NOT NULL, +CREATE TABLE MATERIALORMETHODEVENT_ANNOTATION ( + MATERIALORMETHODEVENT_ID INTEGER NOT NULL, ANNOTATIONS_ID INTEGER NOT NULL, - PRIMARY KEY (MATERIALANDMETHOD_ID, ANNOTATIONS_ID) + PRIMARY KEY (MATERIALORMETHODEVENT_ID, ANNOTATIONS_ID) ); -CREATE TABLE MATERIALANDMETHOD_ANNOTATION_AUD ( +CREATE TABLE MATERIALORMETHODEVENT_ANNOTATION_AUD ( REV INTEGER NOT NULL, REVTYPE TINYINT, - MATERIALANDMETHOD_ID INTEGER NOT NULL, + MATERIALORMETHODEVENT_ID INTEGER NOT NULL, ANNOTATIONS_ID INTEGER NOT NULL, ); -CREATE TABLE MATERIALANDMETHOD_MARKER ( - MATERIALANDMETHOD_ID INTEGER NOT NULL, +CREATE TABLE MATERIALORMETHODEVENT_MARKER ( + MATERIALORMETHODEVENT_ID INTEGER NOT NULL, MARKERS_ID INTEGER NOT NULL, - PRIMARY KEY (MATERIALANDMETHOD_ID, MARKERS_ID) + PRIMARY KEY (MATERIALORMETHODEVENT_ID, MARKERS_ID) ); -CREATE TABLE MATERIALANDMETHOD_MARKER_AUD ( +CREATE TABLE MATERIALORMETHODEVENT_MARKER_AUD ( REV INTEGER NOT NULL, REVTYPE TINYINT, - MATERIALANDMETHOD_ID INTEGER NOT NULL, + MATERIALORMETHODEVENT_ID INTEGER NOT NULL, MARKERS_ID INTEGER NOT NULL, ); @@ -3420,7 +3376,7 @@ CREATE TABLE SINGLEREAD ( UPDATEDBY_ID INTEGER, ACTOR_ID INTEGER, AMPLIFICATION_ID INTEGER, - MATERIALANDMETHOD_ID INTEGER, + MATERIALORMETHOD_ID INTEGER, PHEROGRAM_ID INTEGER, PRIMER_ID INTEGER, PRIMARY KEY (ID) @@ -3443,7 +3399,7 @@ CREATE TABLE SINGLEREAD_AUD ( UPDATEDBY_ID INTEGER, ACTOR_ID INTEGER, AMPLIFICATION_ID INTEGER, - MATERIALANDMETHOD_ID INTEGER, + MATERIALORMETHOD_ID INTEGER, PHEROGRAM_ID INTEGER, PRIMER_ID INTEGER ); diff --git a/cdmlib-io/src/test/resources/dbscripts/001-cdm.h2.sql b/cdmlib-io/src/test/resources/dbscripts/001-cdm.h2.sql index 89ed4af6a0..96ccbb9040 100644 --- a/cdmlib-io/src/test/resources/dbscripts/001-cdm.h2.sql +++ b/cdmlib-io/src/test/resources/dbscripts/001-cdm.h2.sql @@ -466,12 +466,12 @@ CREATE CACHED TABLE PUBLIC.CDMMETADATA( CREATEDBY_ID INTEGER ); -- 3 +/- SELECT COUNT(*) FROM PUBLIC.CDMMETADATA; -CREATE CACHED TABLE PUBLIC.CDMPREFERENCES( - SUBJECT VARCHAR(255), - PREDICATE VARCHAR(255), +CREATE CACHED TABLE PUBLIC.CDMPREFERENCE( + KEY_SUBJECT VARCHAR(100), + KEY_PREDICATE VARCHAR(100), VALUE VARCHAR(1023) ); --- 3 +/- SELECT COUNT(*) FROM PUBLIC.CDMMETADATA; +-- 3 +/- SELECT COUNT(*) FROM PUBLIC.CDMPREFERENCE; CREATE CACHED TABLE PUBLIC.CLASSIFICATION( ID INTEGER NOT NULL, CREATED TIMESTAMP, @@ -598,72 +598,6 @@ CREATE CACHED TABLE PUBLIC.CLASSIFICATION_TAXONNODE_AUD( REVTYPE TINYINT ); -CREATE TABLE PUBLIC.CLONING ( - ID INTEGER NOT NULL, - UUID VARCHAR(36), - CREATED TIMESTAMP, - UPDATED TIMESTAMP, - CREATEDBY_ID INTEGER, - UPDATEDBY_ID INTEGER, - DESCRIPTION VARCHAR(255), - TIMEPERIOD_END VARCHAR(255), - TIMEPERIOD_FREETEXT VARCHAR(255), - TIMEPERIOD_START VARCHAR(255), - STRAIN VARCHAR(255), - METHOD_ID INTEGER, - ACTOR_ID INTEGER, - FORWARDPRIMER_ID INTEGER, - REVERSEPRIMER_ID INTEGER, - PRIMARY KEY (ID) -); - -CREATE TABLE PUBLIC.CLONING_AUD ( - ID INTEGER NOT NULL, - REV INTEGER NOT NULL, - REVTYPE TINYINT, - CREATED TIMESTAMP, - UUID VARCHAR(36), - UPDATED TIMESTAMP, - DESCRIPTION VARCHAR(255), - TIMEPERIOD_END VARCHAR(255), - TIMEPERIOD_FREETEXT VARCHAR(255), - TIMEPERIOD_START VARCHAR(255), - METHOD_ID INTEGER, - STRAIN VARCHAR(255), - CREATEDBY_ID INTEGER, - UPDATEDBY_ID INTEGER, - ACTOR_ID INTEGER, - FORWARDPRIMER_ID INTEGER, - REVERSEPRIMER_ID INTEGER -); - - -CREATE TABLE PUBLIC.CLONING_ANNOTATION ( - CLONING_ID INTEGER NOT NULL, - ANNOTATIONS_ID INTEGER NOT NULL, - PRIMARY KEY (CLONING_ID, ANNOTATIONS_ID) -); - -CREATE TABLE PUBLIC.CLONING_ANNOTATION_AUD ( - REV INTEGER NOT NULL, - REVTYPE TINYINT, - CLONING_ID INTEGER NOT NULL, - ANNOTATIONS_ID INTEGER NOT NULL -); - -CREATE TABLE PUBLIC.CLONING_MARKER ( - CLONING_ID INTEGER NOT NULL, - MARKERS_ID INTEGER NOT NULL, - PRIMARY KEY (CLONING_ID, MARKERS_ID) -); - -CREATE TABLE PUBLIC.CLONING_MARKER_AUD ( - REV INTEGER NOT NULL, - REVTYPE TINYINT, - CLONING_ID INTEGER NOT NULL, - MARKERS_ID INTEGER NOT NULL -); - -- 0 +/- SELECT COUNT(*) FROM PUBLIC.CLASSIFICATION_TAXONNODE_AUD; CREATE CACHED TABLE PUBLIC.COLLECTION( ID INTEGER NOT NULL, @@ -2190,52 +2124,74 @@ CREATE CACHED TABLE PUBLIC.MARKER_AUD( MARKERTYPE_ID INTEGER ); -CREATE TABLE MATERIALANDMETHOD ( +CREATE TABLE MATERIALORMETHODEVENT ( ID INTEGER NOT NULL, + DTYPE VARCHAR(255), CREATED TIMESTAMP, UUID VARCHAR(36), UPDATED TIMESTAMP, - MATERIALMETHODTERM BINARY(255), MATERIALMETHODTEXT VARCHAR(255), + DESCRIPTION VARCHAR(255), + TIMEPERIOD_END VARCHAR(255), + TIMEPERIOD_FREETEXT VARCHAR(255), + TIMEPERIOD_START VARCHAR(255), + STRAIN VARCHAR(255), + TEMPERATURE DOUBLE, CREATEDBY_ID INTEGER, UPDATEDBY_ID INTEGER, + MATERIALMETHODTERM_ID INTEGER, + ACTOR_ID INTEGER, + FORWARDPRIMER_ID INTEGER, + REVERSEPRIMER_ID INTEGER, + MEDIUM_ID INTEGER, PRIMARY KEY (ID) ); -CREATE TABLE MATERIALANDMETHOD_AUD ( +CREATE TABLE MATERIALORMETHODEVENT_AUD ( ID INTEGER NOT NULL, + DTYPE VARCHAR(255), CREATED TIMESTAMP, UUID VARCHAR(36), UPDATED TIMESTAMP, - MATERIALMETHODTERM BINARY(255), MATERIALMETHODTEXT VARCHAR(255), + DESCRIPTION VARCHAR(255), + TIMEPERIOD_END VARCHAR(255), + TIMEPERIOD_FREETEXT VARCHAR(255), + TIMEPERIOD_START VARCHAR(255), + STRAIN VARCHAR(255), + TEMPERATURE DOUBLE, CREATEDBY_ID INTEGER, UPDATEDBY_ID INTEGER, + MATERIALMETHODTERM_ID INTEGER, + ACTOR_ID INTEGER, + FORWARDPRIMER_ID INTEGER, + REVERSEPRIMER_ID INTEGER, + MEDIUM_ID INTEGER ); -CREATE TABLE MATERIALANDMETHOD_ANNOTATION ( - MATERIALANDMETHOD_ID INTEGER NOT NULL, +CREATE TABLE MATERIALORMETHODEVENT_ANNOTATION ( + MATERIALORMETHODEVENT_ID INTEGER NOT NULL, ANNOTATIONS_ID INTEGER NOT NULL, - PRIMARY KEY (MATERIALANDMETHOD_ID, ANNOTATIONS_ID) + PRIMARY KEY (MATERIALORMETHODEVENT_ID, ANNOTATIONS_ID) ); -CREATE TABLE MATERIALANDMETHOD_ANNOTATION_AUD ( +CREATE TABLE MATERIALORMETHODEVENT_ANNOTATION_AUD ( REV INTEGER NOT NULL, REVTYPE TINYINT, - MATERIALANDMETHOD_ID INTEGER NOT NULL, + MATERIALORMETHODEVENT_ID INTEGER NOT NULL, ANNOTATIONS_ID INTEGER NOT NULL, ); -CREATE TABLE MATERIALANDMETHOD_MARKER ( - MATERIALANDMETHOD_ID INTEGER NOT NULL, +CREATE TABLE MATERIALORMETHODEVENT_MARKER ( + MATERIALORMETHODEVENT_ID INTEGER NOT NULL, MARKERS_ID INTEGER NOT NULL, - PRIMARY KEY (MATERIALANDMETHOD_ID, MARKERS_ID) + PRIMARY KEY (MATERIALORMETHODEVENT_ID, MARKERS_ID) ); -CREATE TABLE MATERIALANDMETHOD_MARKER_AUD ( +CREATE TABLE MATERIALORMETHODEVENT_MARKER_AUD ( REV INTEGER NOT NULL, REVTYPE TINYINT, - MATERIALANDMETHOD_ID INTEGER NOT NULL, + MATERIALORMETHODEVENT_ID INTEGER NOT NULL, MARKERS_ID INTEGER NOT NULL, ); @@ -3420,7 +3376,7 @@ CREATE TABLE SINGLEREAD ( UPDATEDBY_ID INTEGER, ACTOR_ID INTEGER, AMPLIFICATION_ID INTEGER, - MATERIALANDMETHOD_ID INTEGER, + MATERIALORMETHOD_ID INTEGER, PHEROGRAM_ID INTEGER, PRIMER_ID INTEGER, PRIMARY KEY (ID) @@ -3443,7 +3399,7 @@ CREATE TABLE SINGLEREAD_AUD ( UPDATEDBY_ID INTEGER, ACTOR_ID INTEGER, AMPLIFICATION_ID INTEGER, - MATERIALANDMETHOD_ID INTEGER, + MATERIALORMETHOD_ID INTEGER, PHEROGRAM_ID INTEGER, PRIMER_ID INTEGER ); diff --git a/cdmlib-io/src/test/resources/eu/etaxonomy/cdm/io/jaxb/CdmImporterTest.xml b/cdmlib-io/src/test/resources/eu/etaxonomy/cdm/io/jaxb/CdmImporterTest.xml index e60e6ed9d70b988748807e7c8a602824dc84f8e4..fa709169c43b51178bb403a09c7106c0afbbb7b2 100644 GIT binary patch delta 130 zcmWN=yA6U+06@_I{*Wh#qKJs1;)mx7ZeU_z9KaDA!Qw7pLh?!nur(o6E@5Hg6f~B4 zl2d-~TKRuLL&u;(l^S&#m^85vw6Jk#qISC7vtXPvi hWRfYjuw}l_q_fd?M|FLRK%Ea}s7@b4blEMQ?Az|ztYEdB*ZNUn4MTN6r`u&{9o8cY3> zFaO>}{(nVaAt_L#M41XURca{eG;nC*(xOd=E 1023) {throw new IllegalArgumentException( @@ -126,8 +130,14 @@ public class CdmPreferences implements Serializable { public String getValue() { return value; } - - //TODO do we need a setter? + + public PrefKey getKey() { + return key; + } + + public void setValue(String value) { + this.value = value; + } } diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/EventBase.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/EventBase.java index 639471f412..e1445740b3 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/EventBase.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/EventBase.java @@ -59,16 +59,12 @@ public abstract class EventBase extends AnnotatableEntity implements IEvent { @Field(index=Index.YES) private String description; - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.model.occurrence.IEvent#getTimeperiod() - */ +//******************** GETTER / SETTER *******************/ + @Override public TimePeriod getTimeperiod() { return timeperiod; } - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.model.occurrence.IEvent#setTimeperiod(eu.etaxonomy.cdm.model.common.TimePeriod) - */ @Override public void setTimeperiod(TimePeriod timeperiod) { if (timeperiod == null){ @@ -77,29 +73,26 @@ public abstract class EventBase extends AnnotatableEntity implements IEvent { this.timeperiod = timeperiod; } - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.model.occurrence.IEvent#getActor() - */ @Override public AgentBase getActor() { return actor; } - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.model.occurrence.IEvent#setActor(eu.etaxonomy.cdm.model.agent.Agent) - */ @Override public void setActor(AgentBase actor) { this.actor = actor; } - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.model.occurrence.IEvent#getDescription() + /** + * The description of this event. Implementing classes may use this field for different purposes. + * @return */ public String getDescription() { return description; } - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.model.occurrence.IEvent#setDescription(java.lang.String) + + /** + * @see #getDescription() + * @param description */ public void setDescription(String description) { this.description = description; @@ -120,7 +113,7 @@ public abstract class EventBase extends AnnotatableEntity implements IEvent { @Override public Object clone() throws CloneNotSupportedException{ EventBase result = (EventBase)super.clone(); - //Actor + //Actor //is this needed?? result.setActor(this.getActor()); //time period result.setTimeperiod((TimePeriod)this.getTimeperiod().clone()); diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ISimpleTerm.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ISimpleTerm.java index 75cc111610..431915ca1b 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ISimpleTerm.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ISimpleTerm.java @@ -56,7 +56,6 @@ public interface ISimpleTerm { * the direct descendants and there recursive descendants (all descendants) * will be returned. */ - //TODO move up to ISimpleTerm public Set getGeneralizationOf(boolean recursive); } diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MaterialAndMethod.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MaterialAndMethod.java deleted file mode 100644 index 892c7be347..0000000000 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/MaterialAndMethod.java +++ /dev/null @@ -1,93 +0,0 @@ -/** -* Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy -* http://www.e-taxonomy.eu -* -* The contents of this file are subject to the Mozilla Public License Version 1.1 -* See LICENSE.TXT at the top of this package for the full license terms. -*/ -package eu.etaxonomy.cdm.model.common; - -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.ManyToOne; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlIDREF; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlType; - -import org.apache.log4j.Logger; -import org.hibernate.envers.Audited; - -import eu.etaxonomy.cdm.model.common.AnnotatableEntity; - -/** - * @author a.mueller - * @created 2013-07-08 - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "MaterialOrMethod", propOrder = { - "materialMethodTerm", - "materialMethodText" -}) -@XmlRootElement(name = "MaterialOrMethod") -@Entity -@Audited -//TODO which base class (..., identifiable, definedTerm, ...) -public class MaterialAndMethod extends AnnotatableEntity { - private static final long serialVersionUID = -4799205199942053585L; - - @SuppressWarnings("unused") - private static final Logger logger = Logger.getLogger(MaterialAndMethod.class); - - @XmlElement(name = "MaterialMethodTerm") - @XmlIDREF - @XmlSchemaType(name = "IDREF") - @ManyToOne(fetch=FetchType.LAZY) - private DefinedTerm materialMethodTerm; - - @XmlElement(name = "MaterialMethodText") - private String materialMethodText; - - - - //TODO citation / link - - -// ******************** FACTORY METHOD ******************/ - -// ********************* CONSTRUCTOR ********************/ - -// ********************* GETTER / SETTER ********************/ - - /** - * A freetext describing the material or method or if - * a {@link #getMaterialMethodTerm() defined method} is given - * an additional information about how this method was used. - */ - public String getMaterialMethodText() { - return materialMethodText; - } - - /** - * @see #getMaterialMethodText() - */ - public void setMaterialMethodText(String materialMethodText) { - this.materialMethodText = materialMethodText; - } - - public DefinedTerm getMaterialMethodTerm() { - return materialMethodTerm; - } - - public void setMaterialMethodTerm(DefinedTerm materialMethodTerm) { - this.materialMethodTerm = materialMethodTerm; - } - -// ********************* CLONE ********************/ - -} diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermType.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermType.java index ed4e801527..b6b5d3eab0 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermType.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/TermType.java @@ -119,7 +119,7 @@ public enum TermType implements IEnumTerm, Serializable{ * @see Marker */ @XmlEnumValue("MarkerType") - MarkerType(UUID.fromString("d28a1bf8-95ed-483a-8f02-3515b14998e0"), "MarkerType", "MAT", null), + MarkerType(UUID.fromString("d28a1bf8-95ed-483a-8f02-3515b14998e0"), "MarkerType", "MKT", null), //7 /** @@ -261,9 +261,27 @@ public enum TermType implements IEnumTerm, Serializable{ StatisticalMeasure(UUID.fromString("a22d19cd-a342-4af2-b156-d688a7aa8a6b"), "Statistical measure", "SM", null), //23 - @XmlEnumValue("PreservationMethod") - PreservationMethod(UUID.fromString("9cadbee4-22b5-40f5-bb37-e4f5340d246e"), "Preservation method", "PRM"), + @XmlEnumValue("MaterialOrMethod") + MaterialOrMethod(UUID.fromString("285a1406-a606-46b9-b0a4-717748296e50"), "Material or Method", "MOM"), + //23a + @XmlEnumValue("Material") + Material(UUID.fromString("58499bc1-9808-4e03-861c-4325ca889515"), "Material", "MAT", MaterialOrMethod), + + //23b + @XmlEnumValue("Method") + Method(UUID.fromString("527fc141-7fdf-43c1-9d46-20be13c2590c"), "Method", "MET", MaterialOrMethod), + + +// //23c TODO required?? +// @XmlEnumValue("PreservationMethod") --> Method +// PreservationMethod(UUID.fromString("9cadbee4-22b5-40f5-bb37-e4f5340d246e"), "Preservation method", "PRM", MaterialOrMethod), +// +// //23d TODO required?? --> Material +// @XmlEnumValue("PreservationMedium") +// PreservationMedium(UUID.fromString("c6269a06-6954-4838-a7a7-7f94ba372f3d"), "Preservation medium", "PME", MaterialOrMethod), + + //24 /** * This type represents possible modulations for the validity of diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/VocabularyEnum.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/VocabularyEnum.java index 000bec1054..69405eb2c5 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/VocabularyEnum.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/VocabularyEnum.java @@ -20,11 +20,11 @@ import eu.etaxonomy.cdm.model.description.PresenceTerm; import eu.etaxonomy.cdm.model.description.State; import eu.etaxonomy.cdm.model.description.StatisticalMeasure; import eu.etaxonomy.cdm.model.description.TextFormat; +import eu.etaxonomy.cdm.model.location.Country; import eu.etaxonomy.cdm.model.location.NamedArea; import eu.etaxonomy.cdm.model.location.NamedAreaLevel; import eu.etaxonomy.cdm.model.location.NamedAreaType; import eu.etaxonomy.cdm.model.location.ReferenceSystem; -import eu.etaxonomy.cdm.model.location.Country; import eu.etaxonomy.cdm.model.media.RightsType; import eu.etaxonomy.cdm.model.name.HybridRelationshipType; import eu.etaxonomy.cdm.model.name.NameRelationshipType; @@ -33,7 +33,6 @@ import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType; import eu.etaxonomy.cdm.model.name.Rank; import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus; import eu.etaxonomy.cdm.model.occurrence.DerivationEventType; -import eu.etaxonomy.cdm.model.occurrence.PreservationMethod; import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType; import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; @@ -71,7 +70,7 @@ public enum VocabularyEnum { AbsenceTerm("5cd438c8-a8a1-4958-842e-169e83e2ceee", AbsenceTerm.class), Sex("9718b7dd-8bc0-4cad-be57-3c54d4d432fe", DefinedTerm.class), DerivationEventType("398b50bb-348e-4fe0-a7f5-a75afd846d1f", DerivationEventType.class), - PreservationMethod("a7dc20c9-e6b3-459e-8f05-8d6d8fceb465", PreservationMethod.class), +// PreservationMethod("a7dc20c9-e6b3-459e-8f05-8d6d8fceb465", DefinedTerm.class), DeterminationModifier("fe87ea8d-6e0a-4e5d-b0da-0ab8ea67ca77", DefinedTerm.class), StatisticalMeasure("066cc62e-7213-495e-a020-97a1233bc037", StatisticalMeasure.class), RightsType("8627c526-73af-44d9-902c-11c1f11b60b4", RightsType.class), diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/DescriptionElementBase.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/DescriptionElementBase.java index 7805d4bceb..88bd5059e4 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/DescriptionElementBase.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/description/DescriptionElementBase.java @@ -81,13 +81,13 @@ import eu.etaxonomy.cdm.strategy.merge.MergeMode; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DescriptionElementBase", propOrder = { - "feature", - "inDescription", - "timeperiod", - "modifiers", - "modifyingText", - "media", - "sources" + "feature", + "inDescription", + "timeperiod", + "modifiers", + "modifyingText", + "media", + "sources" }) @Entity @Audited diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/Amplification.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/Amplification.java index 4dc95e7cce..c08f1bb743 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/Amplification.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/Amplification.java @@ -37,9 +37,9 @@ import org.hibernate.search.annotations.NumericField; import eu.etaxonomy.cdm.model.common.DefinedTerm; import eu.etaxonomy.cdm.model.common.EventBase; -import eu.etaxonomy.cdm.model.common.MaterialAndMethod; import eu.etaxonomy.cdm.model.common.TermType; import eu.etaxonomy.cdm.model.media.Media; +import eu.etaxonomy.cdm.model.occurrence.MaterialOrMethodEvent; /** * @author a.mueller @@ -116,7 +116,7 @@ public class Amplification extends EventBase implements Cloneable{ @XmlSchemaType(name = "IDREF") @ManyToOne(fetch=FetchType.LAZY) @Cascade({CascadeType.SAVE_UPDATE}) - private MaterialAndMethod purification; + private MaterialOrMethodEvent purification; @XmlElement(name = "Cloning") @XmlIDREF @@ -310,14 +310,14 @@ public class Amplification extends EventBase implements Cloneable{ /** * The material and/or method used for purification. */ - public MaterialAndMethod getPurification() { + public MaterialOrMethodEvent getPurification() { return purification; } /** * @see #getPurification() */ - public void setPurification(MaterialAndMethod purification) { + public void setPurification(MaterialOrMethodEvent purification) { this.purification = purification; } diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/Cloning.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/Cloning.java index a576b31650..2893f3b542 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/Cloning.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/Cloning.java @@ -8,8 +8,6 @@ */ package eu.etaxonomy.cdm.model.molecular; -import java.util.HashSet; - import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.ManyToOne; @@ -26,9 +24,9 @@ import org.apache.log4j.Logger; import org.hibernate.envers.Audited; import org.hibernate.search.annotations.Field; -import eu.etaxonomy.cdm.model.common.AnnotatableEntity; +import eu.etaxonomy.cdm.model.common.DefinedTerm; import eu.etaxonomy.cdm.model.common.EventBase; -import eu.etaxonomy.cdm.model.common.MaterialAndMethod; +import eu.etaxonomy.cdm.model.occurrence.MaterialOrMethodEvent; /** * Cloning is a method used in {@link Amplification DNA amplification} for multiplying the base @@ -42,16 +40,15 @@ import eu.etaxonomy.cdm.model.common.MaterialAndMethod; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Cloning", propOrder = { "strain", - "method", "forwardPrimer", "reversePrimer" }) @XmlRootElement(name = "Cloning") @Entity @Audited -//TODO which base class (..., identifiable, definedTerm, ...) -public class Cloning extends EventBase implements Cloneable{ +public class Cloning extends MaterialOrMethodEvent implements Cloneable{ private static final long serialVersionUID = 6179007910988646989L; + @SuppressWarnings("unused") private static final Logger logger = Logger.getLogger(Cloning.class); /** @see #getStrain() */ @@ -60,13 +57,6 @@ public class Cloning extends EventBase implements Cloneable{ @Size(max=100) private String strain; - /** @see #getMethod()*/ - @XmlElement(name = "Cloning") - @XmlIDREF - @XmlSchemaType(name = "IDREF") - @ManyToOne(fetch=FetchType.LAZY) - private MaterialAndMethod method; - /** @see #getForwardPrimer() */ @XmlElement(name = "ForwardPrimer") @XmlIDREF @@ -84,25 +74,28 @@ public class Cloning extends EventBase implements Cloneable{ // ******************** FACTORY METHOD ******************/ + public static Cloning NewInstance(){ + return new Cloning(); + } + + public static Cloning NewInstance(DefinedTerm methodTerm, String methodText, String strain, Primer forwardPrimer, Primer reversePrimer){ + return new Cloning(methodTerm, methodText, strain, forwardPrimer, reversePrimer); + } + // ********************* CONSTRUCTOR ********************/ + + private Cloning(){}; + + private Cloning(DefinedTerm methodTerm, String methodText, String strain, Primer forwardPrimer, Primer reversePrimer){ + super(methodTerm, methodText); + this.strain = strain; + this.forwardPrimer = forwardPrimer; + this.reversePrimer = reversePrimer; + } // ********************* GETTER / SETTER ********************/ - /** - * The material and/or method used for cloning. - */ - public MaterialAndMethod getMethod() { - return method; - } - - /** - * @see #getMethod() - */ - public void setMethod(MaterialAndMethod method) { - this.method = method; - } - /** * The primer used for forward cloning. * @see #getReversePrimer() @@ -155,15 +148,9 @@ public class Cloning extends EventBase implements Cloneable{ */ @Override public Object clone() { - try{ - Amplification result = (Amplification)super.clone(); + Cloning result = (Cloning)super.clone(); - //don't change strain, method, forwardPrimer, backwardPrimer - return result; - }catch (CloneNotSupportedException e) { - logger.warn("Object does not implement cloneable"); - e.printStackTrace(); - return null; - } + //don't change strain, forwardPrimer, backwardPrimer + return result; } } diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/SingleRead.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/SingleRead.java index f20042076c..7a49e2b6e5 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/SingleRead.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/molecular/SingleRead.java @@ -28,9 +28,9 @@ import org.hibernate.envers.Audited; import eu.etaxonomy.cdm.model.agent.AgentBase; import eu.etaxonomy.cdm.model.common.EventBase; -import eu.etaxonomy.cdm.model.common.MaterialAndMethod; import eu.etaxonomy.cdm.model.common.TimePeriod; import eu.etaxonomy.cdm.model.media.Media; +import eu.etaxonomy.cdm.model.occurrence.MaterialOrMethodEvent; /** * Instances of this the {@link SingleRead} class describe the process and the result of a single @@ -55,7 +55,7 @@ import eu.etaxonomy.cdm.model.media.Media; "primer", "direction", "pherogram", - "materialAndMethod" + "materialOrMethod" }) @XmlRootElement(name = "Primer") @Entity @@ -97,11 +97,11 @@ public class SingleRead extends EventBase implements Cloneable{ ) private SequenceDirection direction; - @XmlElement(name = "MaterialAndMethod") + @XmlElement(name = "MaterialOrMethod") @XmlIDREF @XmlSchemaType(name = "IDREF") @ManyToOne(fetch = FetchType.LAZY) - private MaterialAndMethod materialAndMethod; + private MaterialOrMethodEvent materialOrMethod; // ******************** FACTORY METHOD ******************/ @@ -198,15 +198,15 @@ public class SingleRead extends EventBase implements Cloneable{ /** * The material and/or method used for this sequencing. */ - public MaterialAndMethod getMaterialAndMethod() { - return materialAndMethod; + public MaterialOrMethodEvent getMaterialOrMethod() { + return materialOrMethod; } /** - * @see #getMaterialAndMethod() + * @see #getMaterialOrMethod() */ - public void setMaterialAndMethod(MaterialAndMethod materialAndMethod) { - this.materialAndMethod = materialAndMethod; + public void setMaterialOrMethod(MaterialOrMethodEvent materialOrMethod) { + this.materialOrMethod = materialOrMethod; } diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/MaterialOrMethodEvent.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/MaterialOrMethodEvent.java new file mode 100644 index 0000000000..e1e483ceb5 --- /dev/null +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/MaterialOrMethodEvent.java @@ -0,0 +1,188 @@ +/** +* Copyright (C) 2007 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ +package eu.etaxonomy.cdm.model.occurrence; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.ManyToOne; +import javax.persistence.Transient; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +import org.apache.log4j.Logger; +import org.hibernate.envers.Audited; +import org.hibernate.search.annotations.IndexedEmbedded; + +import eu.etaxonomy.cdm.model.common.DefinedTerm; +import eu.etaxonomy.cdm.model.common.EventBase; +import eu.etaxonomy.cdm.model.common.TermType; +import eu.etaxonomy.cdm.model.common.TermVocabulary; +import eu.etaxonomy.cdm.model.molecular.Cloning; + +/** + * A material or method event handles data on materials or methods used for handling specimen or derived units + * in general. It stores information on what material or method was used, who used it and when it was used. + * For reusable data on materials or methods it is best practice to define these first as {@link DefinedTerm + * defined terms} of type {@link TermType#MaterialOrMethod} TODO and then use this term as {@link #getMaterialMethodTerm() + * material or method term}. If this is not possible or if additional data needs to be added one may also + * use {@link #getDescription() freetext} field inherited from {@link EventBase}. Actor and Date information + * are also handled via {@link EventBase} fields. + * This class may be extended by more specific classes which require structured handling of additional parameters. + * + * In general material or method data is not considered to be CDM core data. Therefore the decision was made to handle + * all the data with a common base class which is {@link MaterialOrMethodEvent} to reduce the number of tables required + * in the underlying databases. + * + * @author a.mueller + * @created 2013-07-08 + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "MaterialOrMethod", propOrder = { + "materialMethodTerm" +}) +@XmlRootElement(name = "MaterialOrMethod") +@Entity +@Inheritance(strategy=InheritanceType.SINGLE_TABLE) +@Audited +public class MaterialOrMethodEvent extends EventBase implements Cloneable{ + private static final long serialVersionUID = -4799205199942053585L; + private static final Logger logger = Logger.getLogger(MaterialOrMethodEvent.class); + + @XmlElement(name = "MaterialMethodTerm") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToOne(fetch=FetchType.LAZY) + @IndexedEmbedded // no depth for terms + private DefinedTerm materialMethodTerm; + + //TODO citation / link + + +// ******************** FACTORY METHOD ******************/ + + public static MaterialOrMethodEvent NewInstance(){ + return new MaterialOrMethodEvent(); + } + + public static MaterialOrMethodEvent NewInstance(DefinedTerm methodTerm, String methodText){ + return new MaterialOrMethodEvent(methodTerm, methodText); + } + +// ********************* CONSTRUCTOR ********************/ + + protected MaterialOrMethodEvent(){}; + + protected MaterialOrMethodEvent(DefinedTerm methodTerm, String methodText){ + this.materialMethodTerm = methodTerm; + this.setDescription(methodText); + } + + +// ********************* GETTER / SETTER ********************/ + + + /** + * The {@link #getDescription()} method is inherited from {@link EventBase}. + * In this class it is used as freetext describing the material or method used + * or if a {@link #getMaterialMethodTerm() defined method} is given as + * an additional information about how this defined method was used. + * + * @see #getMaterialMethodText() + */ + @Override + public String getDescription() { + return super.getDescription(); + } + + + /** + * @see #getDescription() + * @see #setMaterialMethodText(String) + */ + @Override + public void setDescription(String materialMethodText) { + super.setDescription(materialMethodText); + } + + + + /** + * A freetext describing the material or method or if + * a {@link #getMaterialMethodTerm() defined method} is given + * an additional information about how this method was used. + * In future this method could be removed to decrease the number + * of transient getters in the CDM. + */ + @Transient + public String getMaterialMethodText() { + return this.getDescription(); + } + + + /** + * @see #getMaterialMethodText() + */ + public void setMaterialMethodText(String materialMethodText) { + this.setDescription(materialMethodText); + } + + + /** + * A defined material or method given as a defined term in a materialOrMethod + * {@link TermVocabulary term vocabulary}. If such a defined material or method is used + * the {@link #getDescription() description} should primarily focus on describing + * deviation from this method rather then repeating it. + * + * @see #getDescription() + * @see #getMaterialMethodText() + * @return the material or method term + */ + public DefinedTerm getMaterialMethodTerm() { + return materialMethodTerm; + } + + /** + * @see #getMaterialMethodTerm() + * @param materialMethodTerm + */ + public void setMaterialMethodTerm(DefinedTerm materialMethodTerm) { + this.materialMethodTerm = materialMethodTerm; + } + +// ********************* CLONE ********************/ + /** + * Clones this {@link Cloning}. This is a shortcut that enables to create + * a new instance that differs only slightly from this cloning by + * modifying only some of the attributes.

+ * + * @see EventBase#clone() + * @see java.lang.Object#clone() + */ + @Override + public Object clone() { + try{ + MaterialOrMethodEvent result = (MaterialOrMethodEvent)super.clone(); + + //don't change materialMethodTerm + return result; + }catch (CloneNotSupportedException e) { + logger.warn("Object does not implement cloneable"); + e.printStackTrace(); + return null; + } + } +} diff --git a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java index f836b0bb32..ce4055ab13 100644 --- a/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java +++ b/cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/occurrence/PreservationMethod.java @@ -1,101 +1,137 @@ -/** -* Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy -* http://www.e-taxonomy.eu -* -* The contents of this file are subject to the Mozilla Public License Version 1.1 -* See LICENSE.TXT at the top of this package for the full license terms. -*/ - -package eu.etaxonomy.cdm.model.occurrence; - -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import eu.etaxonomy.cdm.model.common.DefinedTermBase; -import eu.etaxonomy.cdm.model.common.TermType; -import eu.etaxonomy.cdm.model.common.TermVocabulary; - -import org.apache.log4j.Logger; -import org.hibernate.envers.Audited; -import org.hibernate.search.annotations.Indexed; - -import javax.persistence.*; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -/** - * http://rs.tdwg.org/ontology/voc/Collection.rdf#SpecimenPreservationMethodTypeTerm - * @author m.doering - * @created 08-Nov-2007 13:06:44 - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "PreservationMethod") -@XmlRootElement(name = "PreservationMethod") -@Entity -@Indexed(index = "eu.etaxonomy.cdm.model.common.DefinedTermBase") -@Audited -public class PreservationMethod extends DefinedTermBase { - private static final long serialVersionUID = -6597303767771121540L; - @SuppressWarnings("unused") - private static final Logger logger = Logger.getLogger(PreservationMethod.class); - - protected static Map termMap = null; - - -//********************************** FACTORY METHOD *********************************/ - - /** - * Factory method - * @return - */ - public static PreservationMethod NewInstance(){ - return new PreservationMethod(); - } - - /** - * Factory method - * @return - */ - public static PreservationMethod NewInstance(String term, String label, String labelAbbrev) { - return new PreservationMethod(term, label, labelAbbrev); - } - -//********************************** CONSTRUCTOR *********************************/ - - //for hibernate use only - @Deprecated - protected PreservationMethod() { - super(TermType.PreservationMethod); - } - - - /** - * Constructor - */ - protected PreservationMethod(String term, String label, String labelAbbrev) { - super(TermType.PreservationMethod, term, label, labelAbbrev); - } - -// *************************** METHODS ******************************************************/ - - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.model.common.DefinedTermBase#resetTerms() - */ - @Override - public void resetTerms(){ - termMap = null; - } - - - @Override - protected void setDefaultTerms(TermVocabulary termVocabulary){ - termMap = new HashMap(); - for (PreservationMethod term : termVocabulary.getTerms()){ - termMap.put(term.getUuid(), term); - } - } -} +/** +* Copyright (C) 2007 EDIT +* European Distributed Institute of Taxonomy +* http://www.e-taxonomy.eu +* +* The contents of this file are subject to the Mozilla Public License Version 1.1 +* See LICENSE.TXT at the top of this package for the full license terms. +*/ +package eu.etaxonomy.cdm.model.occurrence; + +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.ManyToOne; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlIDREF; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +import org.apache.log4j.Logger; +import org.hibernate.envers.Audited; +import org.hibernate.search.annotations.Analyze; +import org.hibernate.search.annotations.Field; +import org.hibernate.search.annotations.IndexedEmbedded; +import org.hibernate.search.annotations.NumericField; + +import eu.etaxonomy.cdm.model.common.DefinedTerm; +import eu.etaxonomy.cdm.model.common.EventBase; +import eu.etaxonomy.cdm.model.common.TermType; +import eu.etaxonomy.cdm.model.molecular.Cloning; + +/** + * This class is a specialization of {@link MaterialOrMethodEvent} which allows to + * specifically store temperature and XXX which are common parameters for preparation. + * + * {@link #getMaterialMethodTerm() Defined methods} taken to describe a Preservation Method + * should be taken from a vocabulary of type {@link TermType#PreservationMethod} + * + * http://rs.tdwg.org/ontology/voc/Collection.rdf#SpecimenPreservationMethodTypeTerm + * + * @author a.mueller + * @created 2013-09-11 + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PreservationMethod", propOrder = { + "medium", + "temperature" +}) +@XmlRootElement(name = "PreservationMethod") +@Entity +//TODO @Indexed(index = "eu.etaxonomy.cdm.model.common.DefinedTermBase") +@Audited +public class PreservationMethod extends MaterialOrMethodEvent implements Cloneable { + private static final long serialVersionUID = 2366116167028862401L; + @SuppressWarnings("unused") + private static final Logger logger = Logger.getLogger(PreservationMethod.class); + + @XmlElement(name = "Medium") + @XmlIDREF + @XmlSchemaType(name = "IDREF") + @ManyToOne(fetch = FetchType.LAZY) + @IndexedEmbedded // no depth for terms + private DefinedTerm medium; + + @XmlElement(name = "Temperature") + @Field(analyze = Analyze.NO) + @NumericField + private Double temperature; + + + // ******************** FACTORY METHOD ******************/ + + public static PreservationMethod NewInstance(){ + return new PreservationMethod(); + } + + public static PreservationMethod NewInstance(DefinedTerm methodTerm, String methodText){ + return new PreservationMethod(methodTerm, methodText, null, null); + } + + public static PreservationMethod NewInstance(DefinedTerm methodTerm, String methodText, DefinedTerm preservationMedium, Double temperature){ + return new PreservationMethod(methodTerm, methodText, preservationMedium, temperature); + } + + + // ********************* CONSTRUCTOR ********************/ + + //for hibernate use only + private PreservationMethod(){}; + + private PreservationMethod(DefinedTerm methodTerm, String methodText, DefinedTerm medium, Double temperature){ + super(methodTerm, methodText); + this.medium = medium; + this.temperature = temperature; + } + + // ********************* GETTER / SETTER ********************/ + + public DefinedTerm getMedium() { + return medium; + } + + + public void setMedium(DefinedTerm medium) { + this.medium = medium; + } + + + public Double getTemperature() { + return temperature; + } + + + public void setTemperature(Double temperature) { + this.temperature = temperature; + } + + // ********************* CLONE ********************/ + /** + * Clones this {@link Cloning}. This is a shortcut that enables to create + * a new instance that differs only slightly from this cloning by + * modifying only some of the attributes.

+ * + * @see EventBase#clone() + * @see java.lang.Object#clone() + */ + @Override + public Object clone() { + PreservationMethod result = (PreservationMethod)super.clone(); + + //don't change medium, temperature + return result; + } +} diff --git a/cdmlib-model/src/main/resources/terms/MarkerType.csv b/cdmlib-model/src/main/resources/terms/MarkerType.csv index 141c9de96f..2657a0732d 100644 --- a/cdmlib-model/src/main/resources/terms/MarkerType.csv +++ b/cdmlib-model/src/main/resources/terms/MarkerType.csv @@ -1,4 +1,4 @@ -"19dffff7-e142-429c-a420-5d28e4ebe305",,"MarkerType","MarkerType","MAT","0" +"19dffff7-e142-429c-a420-5d28e4ebe305",,"MarkerType","MarkerType","MKT","0" "96878790-4ceb-42a2-9738-a2242079b679",,"imported","imported", "34204192-b41d-4857-a1d4-28992bef2a2a",,"to be checked","to be checked", "b51325c8-05fe-421a-832b-d86fc249ef6e",,"is doubtful","is doubtful", diff --git a/cdmlib-model/src/main/resources/terms/PreservationMethod.csv b/cdmlib-model/src/main/resources/terms/PreservationMethod.csv index 9e67eca52c..00c6b0c6d7 100644 --- a/cdmlib-model/src/main/resources/terms/PreservationMethod.csv +++ b/cdmlib-model/src/main/resources/terms/PreservationMethod.csv @@ -1 +1,6 @@ -"a7dc20c9-e6b3-459e-8f05-8d6d8fceb465",,"Preservation Method","Preservation Method","PRM","1" \ No newline at end of file +"a7dc20c9-e6b3-459e-8f05-8d6d8fceb465",,"Preservation Method","Preservation Method","PRM","1" + +TODO use TDWG Vocabulary instead: http://rs.tdwg.org/ontology/voc/Collection.rdf#SpecimenPreservationMethodTypeTerm + +https://dev.e-taxonomy.eu/trac/ticket/3715 + diff --git a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v31_33/SchemaUpdater_31_33.java b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v31_33/SchemaUpdater_31_33.java index ed58c00dbc..2ce4ff48ee 100644 --- a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v31_33/SchemaUpdater_31_33.java +++ b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v31_33/SchemaUpdater_31_33.java @@ -41,7 +41,6 @@ import eu.etaxonomy.cdm.model.common.AnnotationType; import eu.etaxonomy.cdm.model.common.ExtensionType; import eu.etaxonomy.cdm.model.common.Language; import eu.etaxonomy.cdm.model.common.MarkerType; -import eu.etaxonomy.cdm.model.common.MaterialAndMethod; import eu.etaxonomy.cdm.model.common.OriginalSourceType; import eu.etaxonomy.cdm.model.common.TermType; import eu.etaxonomy.cdm.model.description.Feature; @@ -63,6 +62,7 @@ import eu.etaxonomy.cdm.model.name.Rank; import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus; import eu.etaxonomy.cdm.model.occurrence.DerivationEventType; import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; +import eu.etaxonomy.cdm.model.occurrence.MaterialOrMethodEvent; import eu.etaxonomy.cdm.model.occurrence.PreservationMethod; import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType; import eu.etaxonomy.cdm.model.reference.Reference; @@ -432,9 +432,9 @@ public class SchemaUpdater_31_33 extends SchemaUpdaterBase { //update reference type updateReferenceType(stepList); - //create table CdmPreferences #3555 - stepName = "Create table 'CdmPreferences'"; - tableName = "CdmPreferences"; + //create table CdmPreference #3555 + stepName = "Create table 'CdmPreference'"; + tableName = "CdmPreference"; TableCreator stepPref = TableCreator.NewInstance(stepName, tableName, new String[]{"key_subject", "key_predicate","value"}, //colNames new String[]{"string_100", "string_200","string_1023",}, // columnTypes @@ -549,7 +549,8 @@ public class SchemaUpdater_31_33 extends SchemaUpdaterBase { int length; Integer defaultValue; String referencedTable; - //Amplification #3360 + + //Primer #3360 stepName = "Create table 'Primer'"; tableName = "Primer"; step = TableCreator.NewAnnotatableInstance(stepName, tableName, @@ -559,27 +560,43 @@ public class SchemaUpdater_31_33 extends SchemaUpdaterBase { INCLUDE_AUDIT); stepList.add(step); - //MaterialAndMethod #3360 - stepName = "Create table 'MaterialAndMethod'"; - tableName = MaterialAndMethod.class.getSimpleName(); - step = TableCreator.NewAnnotatableInstance(stepName, tableName, - new String[]{"DTYPE", "materialMethodTerm_id","materialMethodText"}, //colNames - new String[]{"string_255", "int","string_1000",}, // columnTypes - new String[]{null, "DefinedTermBase",null}, //referencedTables + //MaterialOrMethod #3360 + stepName = "Create table 'MaterialOrMethodEvent'"; + tableName = MaterialOrMethodEvent.class.getSimpleName(); + step = TableCreator.NewEventInstance(stepName, tableName, + new String[]{"DTYPE", "strain","temperature","materialMethodTerm_id", "forwardPrimer_id","reversePrimer_id","medium_id"}, //colNames + new String[]{"string_255", "string_255", "double", "int","int", "int", "int"}, // columnTypes + new String[]{null, null, null, "DefinedTermBase","Primer","Primer","DefinedTermBase"}, //referencedTables INCLUDE_AUDIT); stepList.add(step); - //Cloning #3360 - stepName = "Create table 'Cloning'"; - tableName = "Cloning"; - String matMetName = MaterialAndMethod.class.getSimpleName(); - step = TableCreator.NewEventInstance(stepName, tableName, - new String[]{"strain","method_id","forwardPrimer_id","reversePrimer_id"}, //colNames - new String[]{"string_255", "int","int","int"}, // columnTypes - new String[]{null, matMetName,"Primer","Primer"}, //referencedTables - INCLUDE_AUDIT); + stepName = "Remove preservation column from SpecimenOrObservationBase"; + //to fully remove all foreign keys, maybe there is a better way todo so + //we don't expect any preservation information to exist in any CDM database + tableName = "SpecimenOrObservationBase"; + String oldColumnName = "preservation_id"; + step = ColumnRemover.NewInstance(stepName, tableName, oldColumnName, INCLUDE_AUDIT); stepList.add(step); + stepName = "Add new preservation column to SpecimenOrObservationBase"; + tableName = "SpecimenOrObservationBase"; + String newColumnName = "preservation_id"; + boolean notNull = false; + step = ColumnAdder.NewIntegerInstance(stepName, tableName, newColumnName, INCLUDE_AUDIT, notNull, "MaterialOrMethodEvent"); + stepList.add(step); + + +// //Cloning #3360 +// stepName = "Create table 'Cloning'"; +// tableName = "Cloning"; +// String matMetName = MaterialOrMethodEvent.class.getSimpleName(); +// step = TableCreator.NewEventInstance(stepName, tableName, +// new String[]{"method_id","forwardPrimer_id","reversePrimer_id"}, //colNames +// new String[]{"string_255", "int","int","int"}, // columnTypes +// new String[]{null, matMetName,"Primer","Primer"}, //referencedTables +// INCLUDE_AUDIT); +// stepList.add(step); +// //Amplification #3360 stepName = "Create table 'Amplification'"; @@ -587,7 +604,7 @@ public class SchemaUpdater_31_33 extends SchemaUpdaterBase { step = TableCreator.NewEventInstance(stepName, tableName, new String[]{"dnaSample_id","dnaMarker_id","forwardPrimer_id","reversePrimer_id","purification_id","cloning_id", "gelPhoto_id", "successful","successText","ladderUsed","electrophoresisVoltage","gelRunningTime","gelConcentration"}, //colNames new String[]{"int","int","int","int","int","int","int", "bit","string_255","string_255","double","double","double"}, // columnTypes - new String[]{"SpecimenOrObservationBase","DefinedTermBase","Primer","Primer",matMetName, matMetName, "Media", null, null, null, null, null, null}, //referencedTables + new String[]{"SpecimenOrObservationBase","DefinedTermBase","Primer","Primer","MaterialOrMethodEvent", "MaterialOrMethodEvent", "Media", null, null, null, null, null, null}, //referencedTables INCLUDE_AUDIT); stepList.add(step); @@ -595,9 +612,9 @@ public class SchemaUpdater_31_33 extends SchemaUpdaterBase { stepName = "Create table 'SingleRead'"; tableName = "SingleRead"; step = TableCreator.NewEventInstance(stepName, tableName, - new String[]{"amplification_id","materialAndMethod_id","primer_id","pherogram_id","direction","sequence_length"}, //colNames + new String[]{"amplification_id","materialOrMethod_id","primer_id","pherogram_id","direction","sequence_length"}, //colNames new String[]{"int","int","int","int","string_3","int"}, // columnTypes - new String[]{"Amplification",matMetName, "Primer","Media", null, null}, //referencedTables + new String[]{"Amplification","MaterialOrMethodEvent", "Primer","Media", null, null}, //referencedTables INCLUDE_AUDIT); //TODO length sequence_string stepList.add(step); @@ -1483,7 +1500,7 @@ public class SchemaUpdater_31_33 extends SchemaUpdaterBase { step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, String.format(query, TermType.InstitutionType.getKey(), TermType.MeasurementUnit.getKey(), TermType.Scope.getKey(), TermType.Stage.getKey(), TermType.State.getKey(), - TermType.TextFormat.getKey(), TermType.Modifier.getKey(), TermType.PreservationMethod.getKey())) + TermType.TextFormat.getKey(), TermType.Modifier.getKey(), TermType.Method.getKey())) .setDefaultAuditing(tableName); stepList.add(step); @@ -1882,7 +1899,7 @@ public class SchemaUpdater_31_33 extends SchemaUpdaterBase { //PreservationMethod query = " UPDATE DefinedTermBase " + - " SET termType = '" + TermType.PreservationMethod.getKey() + "' " + + " SET termType = '" + TermType.Method.getKey() + "' " + " WHERE DTYPE = '" + PreservationMethod.class.getSimpleName() + "' "; step = SimpleSchemaUpdaterStep.NewNonAuditedInstance(stepName, query).setDefaultAuditing(tableName); stepList.add(step); diff --git a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DefinedTermDaoImpl.java b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DefinedTermDaoImpl.java index 478e42eee0..0614da765d 100644 --- a/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DefinedTermDaoImpl.java +++ b/cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/DefinedTermDaoImpl.java @@ -75,7 +75,7 @@ public class DefinedTermDaoImpl extends IdentifiableDaoBase imp public DefinedTermDaoImpl() { super(DefinedTermBase.class); - indexedClasses = new Class[27]; + indexedClasses = new Class[26]; indexedClasses[0] = Rank.class; indexedClasses[1] = AnnotationType.class; indexedClasses[2] = ExtensionType.class; @@ -100,9 +100,8 @@ public class DefinedTermDaoImpl extends IdentifiableDaoBase imp indexedClasses[21] = NameTypeDesignationStatus.class; indexedClasses[22] = NomenclaturalStatusType.class; indexedClasses[23] = SpecimenTypeDesignationStatus.class; - indexedClasses[24] = PreservationMethod.class; - indexedClasses[25] = SynonymRelationshipType.class; - indexedClasses[26] = TaxonRelationshipType.class; + indexedClasses[24] = SynonymRelationshipType.class; + indexedClasses[25] = TaxonRelationshipType.class; } /** @@ -132,9 +131,6 @@ public class DefinedTermDaoImpl extends IdentifiableDaoBase imp } - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.persistence.dao.common.ITitledDao#findByTitleAndClass(java.lang.String, java.lang.Class) - */ @Override public List findByTitleAndClass(String queryString, Class clazz) { checkNotInPriorView("DefinedTermDaoImpl.findByTitleAndClass(String queryString, Class clazz)"); @@ -145,9 +141,6 @@ public class DefinedTermDaoImpl extends IdentifiableDaoBase imp return results; } - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.persistence.dao.common.ITitledDao#findByTitle(java.lang.String, eu.etaxonomy.cdm.persistence.dao.common.ITitledDao.MATCH_MODE, int, int, java.util.List) - */ @Override public List findByTitle(String queryString, MatchMode matchMode, int page, int pagesize, List criteria) { //FIXME is query parametrised? @@ -223,9 +216,6 @@ public class DefinedTermDaoImpl extends IdentifiableDaoBase imp return ((Number)criteria.uniqueResult()).intValue(); } - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.persistence.dao.common.IDefinedTermDao#getDefinedTermByIdInVocabulary(java.lang.String, java.util.UUID, java.lang.Class, java.lang.Integer, java.lang.Integer) - */ @Override public List getDefinedTermByIdInVocabulary(String label, UUID vocUuid, Class clazz, Integer pageSize, Integer pageNumber) { checkNotInPriorView("DefinedTermDaoImpl.getDefinedTermByIdInVocabulary(String label, UUID vocUuid, Class clazz, Integer pageSize, Integer pageNumber)"); @@ -251,8 +241,6 @@ public class DefinedTermDaoImpl extends IdentifiableDaoBase imp return result; } - - @Override public List getDefinedTermByRepresentationAbbrev(String text, Class clazz, Integer pageSize,Integer pageNumber) { checkNotInPriorView("DefinedTermDaoImpl.getDefinedTermByRepresentationAbbrev(String abbrev, Class clazz, Integer pageSize,Integer pageNumber)"); @@ -294,10 +282,6 @@ public class DefinedTermDaoImpl extends IdentifiableDaoBase imp return ((Number)criteria.uniqueResult()).intValue(); } - - /* (non-Javadoc) - * @see eu.etaxonomy.cdm.persistence.dao.common.IDefinedTermDao#getLangaugeByIso(java.lang.String) - */ @Override public Language getLanguageByIso(String iso639) { if (iso639.length() < 2 || iso639.length() > 3) { diff --git a/cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/hibernate.cfg.xml b/cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/hibernate.cfg.xml index ca770e38c1..e70b4d6cbd 100644 --- a/cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/hibernate.cfg.xml +++ b/cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/hibernate.cfg.xml @@ -58,7 +58,7 @@