Project

General

Profile

Revision 03e4c253

ID03e4c2533a755432a759eafc27b897433e179261
Parent a43ff87f
Child af51bfe5

Added by Andreas Müller 2 months ago

ref #6581 add "source" to Classification, TypeDesignation, RelationshipBase and NomenclaturalStatus

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/cdm2cdm/Cdm2CdmImportBase.java
52 52
import eu.etaxonomy.cdm.model.common.MarkerType;
53 53
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
54 54
import eu.etaxonomy.cdm.model.common.RelationshipBase;
55
import eu.etaxonomy.cdm.model.common.SingleSourcedEntityBase;
55 56
import eu.etaxonomy.cdm.model.common.SourcedEntityBase;
56 57
import eu.etaxonomy.cdm.model.common.VersionableEntity;
57 58
import eu.etaxonomy.cdm.model.description.CommonTaxonName;
......
377 378
    }
378 379

  
379 380
    protected NomenclaturalStatus handlePersistedNomenclaturalStatus(NomenclaturalStatus status) throws IllegalAccessException, InvocationTargetException, NoSuchFieldException, SecurityException, IllegalArgumentException, NoSuchMethodException {
380
        NomenclaturalStatus result = handlePersisted((ReferencedEntityBase)status);
381
        NomenclaturalStatus result = handlePersisted((SingleSourcedEntityBase)status);
381 382
        //complete
382 383
        result.setType(detache(result.getType()));
383 384
        return result;
......
861 862
        return result;
862 863
    }
863 864

  
865
    protected <T extends SingleSourcedEntityBase> T  handlePersisted(SingleSourcedEntityBase referencedEntity) throws IllegalAccessException, InvocationTargetException, NoSuchFieldException, SecurityException, IllegalArgumentException, NoSuchMethodException {
866
        T result = handlePersisted((AnnotatableEntity)referencedEntity);
867
        //complete
868
        result.setCitation(detache(result.getCitation()));
869
        return result;
870
    }
871

  
864 872
    protected <T extends DescriptionBase> T  handlePersisted(DescriptionBase descriptionBase) throws IllegalAccessException, InvocationTargetException, NoSuchFieldException, SecurityException, IllegalArgumentException, NoSuchMethodException {
865 873
        T result = handlePersisted((IdentifiableEntity)descriptionBase);
866 874
        //complete
......
885 893
    }
886 894

  
887 895
    protected <T extends RelationshipBase> T  handlePersisted(RelationshipBase relBase) throws IllegalAccessException, InvocationTargetException, NoSuchFieldException, SecurityException, IllegalArgumentException, NoSuchMethodException {
888
        T result = handlePersisted((ReferencedEntityBase)relBase);
896
        T result = handlePersisted((SingleSourcedEntityBase)relBase);
889 897
        return result;
890 898
    }
891 899

  
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/sdd/out/SDDDataSet.java
36 36
import eu.etaxonomy.cdm.model.common.LanguageString;
37 37
import eu.etaxonomy.cdm.model.common.LanguageStringBase;
38 38
import eu.etaxonomy.cdm.model.common.MarkerType;
39
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
40 39
import eu.etaxonomy.cdm.model.common.RelationshipBase;
40
import eu.etaxonomy.cdm.model.common.SingleSourcedEntityBase;
41 41
import eu.etaxonomy.cdm.model.common.SourcedEntityBase;
42 42
import eu.etaxonomy.cdm.model.common.VersionableEntity;
43 43
import eu.etaxonomy.cdm.model.description.Feature;
......
80 80
import eu.etaxonomy.cdm.model.term.DefinedTerm;
81 81
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
82 82
import eu.etaxonomy.cdm.model.term.Representation;
83
import eu.etaxonomy.cdm.model.term.TermTree;
84 83
import eu.etaxonomy.cdm.model.term.TermNode;
84
import eu.etaxonomy.cdm.model.term.TermTree;
85 85
import eu.etaxonomy.cdm.model.term.TermVocabulary;
86 86

  
87 87
/**
......
204 204
    @XmlElements({
205 205
    	@XmlElement(name = "NomenclaturalStatus", namespace = "http://etaxonomy.eu/cdm/model/name/1.0", type = NomenclaturalStatus.class),
206 206
    })
207
    protected List<ReferencedEntityBase> referencedEntities;
207
    protected List<SingleSourcedEntityBase> referencedEntities;
208 208

  
209 209
    @XmlElementWrapper(name = "SourcedEntities")
210 210
    @XmlElements({
......
319 319
        this.references = value;
320 320
    }
321 321

  
322
    public <T extends ReferencedEntityBase> void addReferencedEntities(Collection<T> value) {
322
    public <T extends SingleSourcedEntityBase> void addReferencedEntities(Collection<T> value) {
323 323
    	for (T referencedEntity: value) {
324 324
    		this.referencedEntities.add(referencedEntity);
325 325
    	}
326 326
    }
327
    public List<ReferencedEntityBase> getReferencedEntities() {
327
    public List<SingleSourcedEntityBase> getReferencedEntities() {
328 328
        return referencedEntities;
329 329
    }
330
    public void setReferencedEntities(List<? extends ReferencedEntityBase> value) {
330
    public void setReferencedEntities(List<? extends SingleSourcedEntityBase> value) {
331 331
        this.referencedEntities = new ArrayList<>();
332 332
        referencedEntities.addAll(value);
333 333
    }
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/ReferencedEntityBase.java
36 36
 */
37 37
@XmlAccessorType(XmlAccessType.FIELD)
38 38
@XmlType(name = "ReferencedEntityBase", propOrder = {
39
    "citationMicroReference",
40 39
    "originalNameString",
41
    "citation"
40
    "citation",
41
    "citationMicroReference"
42 42
})
43 43
@XmlRootElement(name = "ReferencedEntityBase")
44 44
@MappedSuperclass
......
73 73
		super();
74 74
	}
75 75

  
76

  
77

  
78 76
	public ReferencedEntityBase(Reference citation, String citationMicroReference,
79 77
			String originalNameString) {
80 78
		this.citationMicroReference = citationMicroReference;
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/RelationshipBase.java
47 47
@MappedSuperclass
48 48
@Audited
49 49
public abstract class RelationshipBase<FROM extends IRelated, TO extends IRelated, TYPE extends RelationshipTermBase>
50
        extends ReferencedEntityBase {
50
        extends SingleSourcedEntityBase {
51 51

  
52 52
    private static final long serialVersionUID = -5030154633820061997L;
53 53
    @SuppressWarnings("unused")
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/common/SingleSourcedEntityBase.java
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

  
10
package eu.etaxonomy.cdm.model.common;
11

  
12

  
13
import javax.persistence.FetchType;
14
import javax.persistence.ManyToOne;
15
import javax.persistence.MappedSuperclass;
16
import javax.xml.bind.annotation.XmlAccessType;
17
import javax.xml.bind.annotation.XmlAccessorType;
18
import javax.xml.bind.annotation.XmlElement;
19
import javax.xml.bind.annotation.XmlIDREF;
20
import javax.xml.bind.annotation.XmlRootElement;
21
import javax.xml.bind.annotation.XmlSchemaType;
22
import javax.xml.bind.annotation.XmlType;
23

  
24
import org.apache.commons.lang.StringUtils;
25
import org.apache.log4j.Logger;
26
import org.hibernate.annotations.Cascade;
27
import org.hibernate.annotations.CascadeType;
28
import org.hibernate.envers.Audited;
29

  
30
import eu.etaxonomy.cdm.model.reference.Reference;
31

  
32
/**
33
 * Abstract class for all objects that may have a reference
34
 * @author m.doering
35
 * @since 08-Nov-2007 13:06:47
36
 */
37
@XmlAccessorType(XmlAccessType.FIELD)
38
@XmlType(name = "SingleSourcedEntityBase", propOrder = {
39
    "source",
40
    "originalNameString",
41
    "citation",
42
    "citationMicroReference"
43
})
44
@XmlRootElement(name = "SingleSourcedEntityBase")
45
@MappedSuperclass
46
@Audited
47
public abstract class SingleSourcedEntityBase
48
        extends AnnotatableEntity
49
        implements IReferencedEntity {
50

  
51
    static final long serialVersionUID = 2035568689268762760L;
52
    @SuppressWarnings("unused")
53
	private static final Logger logger = Logger.getLogger(SingleSourcedEntityBase.class);
54

  
55
	@XmlElement(name = "Citation")
56
    @XmlIDREF
57
    @XmlSchemaType(name = "IDREF")
58
    @ManyToOne(fetch = FetchType.LAZY)
59
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE})
60
	@Deprecated
61
	private Reference citation;
62

  
63
	//Details of the reference. These are mostly (implicitly) pages but can also be tables or any other element of a
64
    //publication. {if the citationMicroReference exists then there must be also a reference}
65
    @XmlElement(name = "CitationMicroReference")
66
    @Deprecated
67
    private String citationMicroReference;
68

  
69
    @XmlElement(name = "OriginalNameString")
70
    @Deprecated
71
    private String originalNameString;
72

  
73
    //the source for this single sourced entity
74
    @XmlElement(name = "source")
75
    @XmlIDREF
76
    @XmlSchemaType(name = "IDREF")
77
    @ManyToOne(fetch = FetchType.LAZY)
78
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE, CascadeType.DELETE})
79
    private IdentifiableSource source;
80

  
81
// ************ CONSTRUCTOR ********************************************/
82

  
83
	//for hibernate use only
84
    protected SingleSourcedEntityBase() {
85
		super();
86
	}
87

  
88
	public SingleSourcedEntityBase(Reference citation, String citationMicroReference,
89
			String originalNameString) {
90
		this.citationMicroReference = citationMicroReference;
91
		this.originalNameString = originalNameString;
92
		this.citation = citation;
93
	}
94

  
95
//********************* GETTER / SETTER *******************************/
96

  
97
	public String getCitationMicroReference(){
98
		return this.citationMicroReference;
99
	}
100
	public void setCitationMicroReference(String citationMicroReference){
101
		this.citationMicroReference = citationMicroReference;
102
	}
103

  
104

  
105
	public String getOriginalNameString(){
106
		return this.originalNameString;
107
	}
108
	public void setOriginalNameString(String originalNameString){
109
		this.originalNameString = originalNameString;
110
	}
111

  
112
	@Override
113
    public Reference getCitation(){
114
		return this.citation;
115
	}
116
	public void setCitation(Reference citation) {
117
		this.citation = citation;
118
	}
119

  
120
// **************** EMPTY ************************/
121

  
122
    @Override
123
    protected boolean isEmpty(){
124
       return super.isEmpty()
125
            && this.getCitation() == null
126
            && this.getCitationMicroReference() == null
127
            && isBlank(this.getOriginalNameString())
128
           ;
129
    }
130

  
131
//****************** CLONE ************************************************/
132

  
133
	@Override
134
	public Object clone() throws CloneNotSupportedException{
135
		SingleSourcedEntityBase result = (SingleSourcedEntityBase)super.clone();
136

  
137
		//no changes to: citation, citationMicroReference, originalNameString
138
		return result;
139
	}
140

  
141
//*********************************** EQUALS *********************************************************/
142

  
143
	/**
144
	 * Indicates whether some other object is "equal to" this one.
145
	 *
146
	 * Uses a content based compare strategy which avoids bean initialization. This is achieved by
147
	 * comparing the cdm entity ids.
148
	 */
149
	public boolean equalsByShallowCompare(SingleSourcedEntityBase other) {
150

  
151
	    int thisCitationId = -1;
152
	    int otherCitationId = -1;
153
	    if(this.getCitation() != null) {
154
	        thisCitationId = this.getCitation().getId();
155
	    }
156
	    if(other.getCitation() != null) {
157
	        otherCitationId = other.getCitation().getId();
158
        }
159

  
160
        if(thisCitationId != otherCitationId
161
                || !StringUtils.equals(this.getCitationMicroReference(), other.getCitationMicroReference())
162
                || !StringUtils.equals(this.getOriginalNameString(), other.getOriginalNameString())
163
                        ){
164
            return false;
165
        }
166

  
167
        return true;
168
    }
169

  
170

  
171
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/NomenclaturalStatus.java
23 23
import org.apache.log4j.Logger;
24 24
import org.hibernate.envers.Audited;
25 25

  
26
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
26
import eu.etaxonomy.cdm.model.common.SingleSourcedEntityBase;
27 27
import eu.etaxonomy.cdm.model.reference.Reference;
28 28

  
29 29
/**
......
43 43
})
44 44
@Entity
45 45
@Audited
46
public class NomenclaturalStatus extends ReferencedEntityBase implements IRuleConsidered{
46
public class NomenclaturalStatus
47
        extends SingleSourcedEntityBase
48
        implements IRuleConsidered{
47 49

  
48 50
	private static final long serialVersionUID = -2451270405173131900L;
49 51
	static Logger logger = Logger.getLogger(NomenclaturalStatus.class);
......
58 60
    @ManyToOne(fetch = FetchType.LAZY)
59 61
	private NomenclaturalStatusType type;
60 62

  
63
// ************************** FACTORY *********************************/
61 64

  
62 65
	/**
63 66
	 * Creates a new nomenclatural status instance with a given
......
84 87
		return status;
85 88
	}
86 89

  
87

  
88 90
// ************************ CONSTRUCTOR *************************/
89 91

  
90 92
	protected NomenclaturalStatus() {
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/name/TypeDesignationBase.java
64 64
    "typifiedNames",
65 65
    "citation",
66 66
    "citationMicroReference",
67
    "source",
67 68
    "registrations",
68 69
})
69 70
@XmlSeeAlso({
......
106 107
    @XmlElement(name = "CitationMicroReference")
107 108
    private String citationMicroReference;
108 109

  
110
    //the source for the lectotypification (or similar)
111
    @XmlElement(name = "source")
112
    @XmlIDREF
113
    @XmlSchemaType(name = "IDREF")
114
    @ManyToOne(fetch = FetchType.LAZY)
115
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE, CascadeType.DELETE})
116
    private IdentifiableSource source;
117

  
109 118
    @XmlElementWrapper(name = "TypifiedNames")
110 119
    @XmlElement(name = "TypifiedName")
111 120
    @XmlIDREF
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/taxon/Classification.java
48 48
import eu.etaxonomy.cdm.jaxb.MultilanguageTextAdapter;
49 49
import eu.etaxonomy.cdm.model.common.IReferencedEntity;
50 50
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
51
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
51 52
import eu.etaxonomy.cdm.model.common.Language;
52 53
import eu.etaxonomy.cdm.model.common.LanguageString;
53 54
import eu.etaxonomy.cdm.model.common.MultilanguageText;
......
67 68
    "rootNode",
68 69
    "reference",
69 70
    "microReference",
71
    "source",
70 72
    "timeperiod",
71 73
    "geoScopes"
72 74
})
......
76 78
@Indexed(index = "eu.etaxonomy.cdm.model.taxon.Classification")
77 79
public class Classification
78 80
            extends IdentifiableEntity<IIdentifiableEntityCacheStrategy<Classification>>
79
            implements IReferencedEntity, ITaxonTreeNode, Cloneable{
81
            implements IReferencedEntity, ITaxonTreeNode{
82

  
80 83
    private static final long serialVersionUID = -753804821474209635L;
81 84
    private static final Logger logger = Logger.getLogger(Classification.class);
82 85

  
......
127 130
//    @FieldBridge(impl=MultilanguageTextFieldBridge.class)
128 131
    private Map<Language,LanguageString> description = new HashMap<>();
129 132

  
133
    //the source for this single classification
134
    @XmlElement(name = "source")
135
    @XmlIDREF
136
    @XmlSchemaType(name = "IDREF")
137
    @ManyToOne(fetch = FetchType.LAZY)
138
    @Cascade({CascadeType.SAVE_UPDATE,CascadeType.MERGE, CascadeType.DELETE})
139
    private IdentifiableSource source;
140

  
130 141

  
131 142
//	/**
132 143
//	 * If this classification is an alternative classification for a subclassification in
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/database/update/v512_515/SchemaUpdater_5151_5152.java
69 69
        referencedTable = "OriginalSourceBase";
70 70
        ColumnAdder.NewIntegerInstance(stepList, stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
71 71

  
72
        //6581
73
        stepName = "Add source to Classification";
74
        tableName = "Classification";
75
        newColumnName = "source_id";
76
        referencedTable = "OriginalSourceBase";
77
        ColumnAdder.NewIntegerInstance(stepList, stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
78

  
79
        //6581
80
        stepName = "Add source to NomenclaturalStatus";
81
        tableName = "NomenclaturalStatus";
82
        newColumnName = "source_id";
83
        referencedTable = "OriginalSourceBase";
84
        ColumnAdder.NewIntegerInstance(stepList, stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
85

  
86
        //6581
87
        stepName = "Add source to TypeDesignationBase";
88
        tableName = "TypeDesignationBase";
89
        newColumnName = "source_id";
90
        referencedTable = "OriginalSourceBase";
91
        ColumnAdder.NewIntegerInstance(stepList, stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
92

  
93
        //6581
94
        stepName = "Add source to TaxonRelationship";
95
        tableName = "TaxonRelationship";
96
        newColumnName = "source_id";
97
        referencedTable = "OriginalSourceBase";
98
        ColumnAdder.NewIntegerInstance(stepList, stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
99

  
100
        //6581
101
        stepName = "Add source to NameRelationship";
102
        tableName = "NameRelationship";
103
        newColumnName = "source_id";
104
        referencedTable = "OriginalSourceBase";
105
        ColumnAdder.NewIntegerInstance(stepList, stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
106

  
107
        //6581
108
        stepName = "Add source to HybridRelationship";
109
        tableName = "HybridRelationship";
110
        newColumnName = "source_id";
111
        referencedTable = "OriginalSourceBase";
112
        ColumnAdder.NewIntegerInstance(stepList, stepName, tableName, newColumnName, INCLUDE_AUDIT, !NOT_NULL, referencedTable);
113

  
72 114
        return stepList;
73 115
    }
74 116

  
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/ISingleSourcedEntityDao.java
1
/**
2
* Copyright (C) 2008 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*/
6

  
7
package eu.etaxonomy.cdm.persistence.dao.common;
8

  
9
import eu.etaxonomy.cdm.model.common.SingleSourcedEntityBase;
10

  
11
/**
12
 * @author a.mueller
13
 * @since 12.06.2020
14
 */
15
public interface ISingleSourcedEntityDao<T extends SingleSourcedEntityBase> extends ICdmEntityDao<T> {
16

  
17
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/SingleSourcedEntityDaoImpl.java
1
/**
2
* Copyright (C) 2008 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*/
6

  
7
package eu.etaxonomy.cdm.persistence.dao.hibernate.common;
8

  
9
import org.springframework.stereotype.Repository;
10

  
11
import eu.etaxonomy.cdm.model.common.SingleSourcedEntityBase;
12
import eu.etaxonomy.cdm.persistence.dao.common.ISingleSourcedEntityDao;
13

  
14
/**
15
 * @author a.mueller
16
 * @since 12.06.2020
17
 */
18
@Repository(value="singleSourcedEntityDao")
19
public abstract class SingleSourcedEntityDaoImpl<T extends SingleSourcedEntityBase> extends CdmEntityDaoBase<T>
20
							implements ISingleSourcedEntityDao<T>{
21

  
22
	@SuppressWarnings("unchecked")
23
    public SingleSourcedEntityDaoImpl() {
24
		super((Class<T>)SingleSourcedEntityBase.class);
25
	}
26

  
27
	public SingleSourcedEntityDaoImpl(Class<T> type) {
28
		super(type);
29
	}
30

  
31
}
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/name/NomenclaturalStatusDaoHibernateImpl.java
1 1
/**
2 2
 * Copyright (C) 2007 EDIT
3
 * European Distributed Institute of Taxonomy 
3
 * European Distributed Institute of Taxonomy
4 4
 * http://www.e-taxonomy.eu
5
 * 
5
 *
6 6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
 * See LICENSE.TXT at the top of this package for the full license terms.
8 8
 *
......
17 17

  
18 18
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
19 19
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
20
import eu.etaxonomy.cdm.persistence.dao.hibernate.common.ReferencedEntityDaoImpl;
20
import eu.etaxonomy.cdm.persistence.dao.hibernate.common.SingleSourcedEntityDaoImpl;
21 21
import eu.etaxonomy.cdm.persistence.dao.name.INomenclaturalStatusDao;
22 22

  
23 23
/**
......
25 25
 *
26 26
 */
27 27
@Repository
28
public class NomenclaturalStatusDaoHibernateImpl 
29
			extends ReferencedEntityDaoImpl<NomenclaturalStatus> implements INomenclaturalStatusDao {
30
	@SuppressWarnings("unused")
28
public class NomenclaturalStatusDaoHibernateImpl
29
			extends SingleSourcedEntityDaoImpl<NomenclaturalStatus> implements INomenclaturalStatusDao {
30

  
31
    @SuppressWarnings("unused")
31 32
	private static final Logger logger = Logger.getLogger(NomenclaturalStatusDaoHibernateImpl.class);
32 33

  
33 34
	public NomenclaturalStatusDaoHibernateImpl() {
34
		super(NomenclaturalStatus.class); 
35
		super(NomenclaturalStatus.class);
35 36
	}
36 37

  
37
	public List<ReferencedEntityBase> getAllNomenclaturalStatus(Integer limit, Integer start) {
38
	@Override
39
    public List<ReferencedEntityBase> getAllNomenclaturalStatus(Integer limit, Integer start) {
38 40
		Criteria crit = getSession().createCriteria(NomenclaturalStatus.class);
39 41
		List<ReferencedEntityBase> results = crit.list();
40 42
		return results;
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/name/INomenclaturalStatusDao.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
......
12 12

  
13 13
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
14 14
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
15
import eu.etaxonomy.cdm.persistence.dao.common.IReferencedEntityDao;
15
import eu.etaxonomy.cdm.persistence.dao.common.ISingleSourcedEntityDao;
16 16

  
17 17
/**
18 18
 * @author a.mueller
19
 *
20 19
 */
21
public interface INomenclaturalStatusDao extends IReferencedEntityDao<NomenclaturalStatus> {
22
	
23
	public List<ReferencedEntityBase> getAllNomenclaturalStatus(Integer limit, Integer start);
20
public interface INomenclaturalStatusDao extends ISingleSourcedEntityDao<NomenclaturalStatus> {
24 21

  
22
	public List<ReferencedEntityBase> getAllNomenclaturalStatus(Integer limit, Integer start);
25 23

  
26 24
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/NameServiceImpl.java
56 56
import eu.etaxonomy.cdm.model.CdmBaseType;
57 57
import eu.etaxonomy.cdm.model.common.CdmBase;
58 58
import eu.etaxonomy.cdm.model.common.Language;
59
import eu.etaxonomy.cdm.model.common.ReferencedEntityBase;
60 59
import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction;
61 60
import eu.etaxonomy.cdm.model.common.SourcedEntityBase;
62 61
import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
......
83 82
import eu.etaxonomy.cdm.model.taxon.Taxon;
84 83
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
85 84
import eu.etaxonomy.cdm.persistence.dao.common.ICdmGenericDao;
86
import eu.etaxonomy.cdm.persistence.dao.common.IReferencedEntityDao;
87 85
import eu.etaxonomy.cdm.persistence.dao.common.ISourcedEntityDao;
88 86
import eu.etaxonomy.cdm.persistence.dao.common.Restriction;
89 87
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
......
120 118
    @Autowired
121 119
    protected ITaxonService taxonService;
122 120
    @Autowired
123
    @Qualifier("refEntDao")
124
    protected IReferencedEntityDao<ReferencedEntityBase> referencedEntityDao;
125
    @Autowired
126 121
    @Qualifier("sourcedEntityDao")
127 122
    protected ISourcedEntityDao<SourcedEntityBase<?>> sourcedEntityDao;
128 123
    @Autowired
......
497 492
    public TypeDesignationBase<?> loadTypeDesignation(UUID uuid, List<String> propertyPaths){
498 493
        return typeDesignationDao.load(uuid, propertyPaths);
499 494
    }
500
    
495

  
501 496
    @Override
502 497
    public List<TypeDesignationBase<?>> loadTypeDesignations(List<UUID> uuids, List<String> propertyPaths){
503 498
    	if(uuids == null) {
cdmlib-test/src/main/resources/dbscripts/001-cdm.h2.sql
560 560
    LSID_REVISION VARCHAR(255),
561 561
    PROTECTEDTITLECACHE BOOLEAN NOT NULL,
562 562
    TITLECACHE VARCHAR(255),
563
    MICROREFERENCE VARCHAR(255),
564 563
    TIMEPERIOD_START VARCHAR(255),
565 564
    TIMEPERIOD_FREETEXT VARCHAR(255),
566 565
    TIMEPERIOD_END VARCHAR(255),
567 566
    CREATEDBY_ID INTEGER,
568 567
    UPDATEDBY_ID INTEGER,
569 568
    NAME_ID INTEGER,
569
    MICROREFERENCE VARCHAR(255),
570 570
    REFERENCE_ID INTEGER,
571
	SOURCE_ID INTEGER,
571 572
    ROOTNODE_ID INTEGER
572 573
);
573 574
-- 1 +/- SELECT COUNT(*) FROM PUBLIC.CLASSIFICATION;
......
593 594
    UPDATEDBY_ID INTEGER,
594 595
    NAME_ID INTEGER,
595 596
    REFERENCE_ID INTEGER,
597
    SOURCE_ID INTEGER,
596 598
    ROOTNODE_ID INTEGER
597 599
);
598 600
-- 1 +/- SELECT COUNT(*) FROM PUBLIC.CLASSIFICATION_AUD;
......
2263 2265
    DOUBTFUL BOOLEAN NOT NULL,
2264 2266
    RULECONSIDERED VARCHAR(255),
2265 2267
	CODEEDITION VARCHAR(20),
2268
    SOURCE_ID INTEGER,
2266 2269
    CREATEDBY_ID INTEGER,
2267 2270
    UPDATEDBY_ID INTEGER,
2268 2271
    CITATION_ID INTEGER,
......
2283 2286
    DOUBTFUL BOOLEAN,
2284 2287
    RULECONSIDERED VARCHAR(255),
2285 2288
    CODEEDITION VARCHAR(20),
2289
    SOURCE_ID INTEGER,
2286 2290
    CREATEDBY_ID INTEGER,
2287 2291
    UPDATEDBY_ID INTEGER,
2288 2292
    CITATION_ID INTEGER,
......
3076 3080
    DOUBTFUL BOOLEAN NOT NULL,
3077 3081
    RULECONSIDERED VARCHAR(255),
3078 3082
    CODEEDITION VARCHAR(20),
3083
    SOURCE_ID INTEGER,
3079 3084
    CREATEDBY_ID INTEGER,
3080 3085
    UPDATEDBY_ID INTEGER,
3081 3086
    CITATION_ID INTEGER,
......
3096 3101
    DOUBTFUL BOOLEAN,
3097 3102
    RULECONSIDERED VARCHAR(255),
3098 3103
	CODEEDITION VARCHAR(20),
3104
    SOURCE_ID INTEGER,
3099 3105
    CREATEDBY_ID INTEGER,
3100 3106
    UPDATEDBY_ID INTEGER,
3101 3107
    CITATION_ID INTEGER,
......
3137 3143
    ORIGINALNAMESTRING VARCHAR(255),
3138 3144
    RULECONSIDERED VARCHAR(255),
3139 3145
    CODEEDITION VARCHAR(20),
3146
    SOURCE_ID INTEGER,
3140 3147
    CREATEDBY_ID INTEGER,
3141 3148
    UPDATEDBY_ID INTEGER,
3142 3149
    CITATION_ID INTEGER,
......
3154 3161
    ORIGINALNAMESTRING VARCHAR(255),
3155 3162
    RULECONSIDERED VARCHAR(255),
3156 3163
    CODEEDITION VARCHAR(20),
3164
    SOURCE_ID INTEGER,
3157 3165
    CREATEDBY_ID INTEGER,
3158 3166
    UPDATEDBY_ID INTEGER,
3159 3167
    CITATION_ID INTEGER,
......
5024 5032
    CITATIONMICROREFERENCE VARCHAR(255),
5025 5033
    ORIGINALNAMESTRING VARCHAR(255),
5026 5034
    DOUBTFUL BOOLEAN NOT NULL,
5035
    SOURCE_ID INTEGER,
5027 5036
    CREATEDBY_ID INTEGER,
5028 5037
    UPDATEDBY_ID INTEGER,
5029 5038
    CITATION_ID INTEGER,
......
5042 5051
    CITATIONMICROREFERENCE VARCHAR(255),
5043 5052
    ORIGINALNAMESTRING VARCHAR(255),
5044 5053
    DOUBTFUL BOOLEAN,
5054
    SOURCE_ID INTEGER,
5045 5055
    CREATEDBY_ID INTEGER,
5046 5056
    UPDATEDBY_ID INTEGER,
5047 5057
    CITATION_ID INTEGER,
......
5312 5322
    UPDATED TIMESTAMP,
5313 5323
    CITATIONMICROREFERENCE VARCHAR(255),
5314 5324
    ORIGINALNAMESTRING VARCHAR(255),
5325
	SOURCE_ID INTEGER,
5315 5326
    NOTDESIGNATED BOOLEAN NOT NULL,
5316 5327
    CONSERVEDTYPE BOOLEAN,
5317 5328
    REJECTEDTYPE BOOLEAN,
......
5334 5345
    UPDATED TIMESTAMP,
5335 5346
    CITATIONMICROREFERENCE VARCHAR(255),
5336 5347
    ORIGINALNAMESTRING VARCHAR(255),
5348
	SOURCE_ID INTEGER,
5337 5349
    NOTDESIGNATED BOOLEAN,
5338 5350
    CREATEDBY_ID INTEGER,
5339 5351
    UPDATEDBY_ID INTEGER,

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)