Project

General

Profile

Revision 61483b42

ID61483b4287f60e5d3a86397912a892f03e2c825b
Parent fefcbafa
Child 23e22bd1

Added by Andreas Kohlbecker over 1 year ago

ref #7114 DerivedUnitConverter now deletes convertion sources:
- DerivedUnitConverterFactory intoduced
- DerivedUnitConverterFactory as spring bean in all appcontexts
- tests adapted

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/utility/DerivedUnitConverter.java
11 11
import java.lang.reflect.InvocationTargetException;
12 12
import java.lang.reflect.Method;
13 13

  
14
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
14 15
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
15 16
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
16 17
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
......
26 27

  
27 28
    private DerivedUnit du;
28 29

  
30
    IOccurrenceService service;
31

  
29 32
    /**
30 33
     * @param specimenTypeDesignation
31 34
     */
32
    public DerivedUnitConverter(DerivedUnit derivedUnit) {
35
    protected DerivedUnitConverter(DerivedUnit derivedUnit, IOccurrenceService service) {
33 36
        if(derivedUnit == null){
34 37
            throw new NullPointerException();
35 38
        }
39
        this.service = service;
36 40
        this.du = HibernateProxyHelper.deproxy(derivedUnit, DerivedUnit.class);
37 41
    }
38 42

  
......
76 80
            throw new DerivedUnitConversionException("Error during intantiation of " + targetType.getName(), e);
77 81
        }
78 82

  
83

  
84
        service.delete(du);
85

  
79 86
        return newInstance;
80 87

  
81 88
    }
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/utility/DerivedUnitConverterFactory.java
1
/**
2
* Copyright (C) 2017 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
package eu.etaxonomy.cdm.api.utility;
10

  
11
import org.springframework.beans.factory.annotation.Autowired;
12

  
13
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
14
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
15

  
16
/**
17
 * @author a.kohlbecker
18
 * @since Dec 14, 2017
19
 *
20
 */
21
public class DerivedUnitConverterFactory {
22

  
23
    private static IOccurrenceService service;
24

  
25
    @Autowired
26
    public void setIOccurrenceService(IOccurrenceService service){
27
        DerivedUnitConverterFactory.service = service;
28
    }
29

  
30
    public static <TARGET extends DerivedUnit> DerivedUnitConverter<TARGET> createDerivedUnitConverter(DerivedUnit derivedUnit, Class<TARGET> targetType){
31
        DerivedUnitConverter<TARGET> converter = new DerivedUnitConverter<TARGET>(derivedUnit, service);
32
        return converter;
33
    }
34

  
35

  
36
}
cdmlib-services/src/main/resources/eu/etaxonomy/cdm/services_base.xml
26 26

  
27 27
    <!-- equips a new and empty database with the initial set of meta data and admin user   -->
28 28
    <bean id="firstDataInserter" class="eu.etaxonomy.cdm.api.application.FirstDataInserter" />
29
    
30
    <!--  only needed as long as DerivedUnit and MediaSpecimen, ... are different classes -->
31
    <bean id="derivedUnitConverterFactory" class="eu.etaxonomy.cdm.api.utility.DerivedUnitConverterFactory" />
29 32
</beans>
cdmlib-services/src/main/resources/eu/etaxonomy/cdm/services_security_base.xml
70 70
    <bean id="firstDataInserter" class="eu.etaxonomy.cdm.api.application.FirstDataInserter">
71 71
        <property name="runAsAuthenticationProvider" ref="runAsAuthenticationProvider"/>
72 72
    </bean>
73
    
74
    <!--  only needed as long as DerivedUnit and MediaSpecimen, ... are different classes -->
75
    <bean id="derivedUnitConverterFactory" class="eu.etaxonomy.cdm.api.utility.DerivedUnitConverterFactory" />
73 76

  
74 77
</beans>
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/utility/DerivedUnitConverterIntegrationTest.java
40 40
        DerivedUnit du = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
41 41
        du.setTitleCache("test derived unit", true);
42 42
        du = (DerivedUnit) service.save(du); // intermediate save is essential for this test
43
        DerivedUnitConverter<MediaSpecimen> duc = new DerivedUnitConverter<MediaSpecimen>(du);
43
        DerivedUnitConverter<MediaSpecimen> duc = DerivedUnitConverterFactory.createDerivedUnitConverter(du, MediaSpecimen.class);
44 44
        MediaSpecimen target = duc.convertTo(MediaSpecimen.class, SpecimenOrObservationType.StillImage);
45 45
        service.save(target);
46 46

  
......
55 55

  
56 56
        MediaSpecimen du = MediaSpecimen.NewInstance(SpecimenOrObservationType.StillImage);
57 57
        du.setTitleCache("test media specimen", true);
58
        DerivedUnitConverter<DerivedUnit> duc = new DerivedUnitConverter<DerivedUnit>(du);
58
        DerivedUnitConverter<DerivedUnit> duc = DerivedUnitConverterFactory.createDerivedUnitConverter(du, DerivedUnit.class);
59 59
        du = (MediaSpecimen) service.save(du); // intermediate save is essential for this test
60 60
        DerivedUnit target = duc.convertTo(DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen);
61 61
        service.save(target);
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/utility/DerivedUnitConverterTest.java
8 8
*/
9 9
package eu.etaxonomy.cdm.api.utility;
10 10

  
11
import java.io.IOException;
12
import java.util.Collection;
13
import java.util.List;
14
import java.util.Map;
15
import java.util.Set;
16
import java.util.UUID;
17

  
18
import org.hibernate.LockOptions;
19
import org.hibernate.Session;
20
import org.hibernate.criterion.Criterion;
21
import org.hibernate.envers.query.criteria.AuditCriterion;
22
import org.hibernate.search.spatial.impl.Rectangle;
11 23
import org.junit.Assert;
12 24
import org.junit.Test;
13 25

  
26
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
27
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
28
import eu.etaxonomy.cdm.api.service.DeleteResult;
29
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
30
import eu.etaxonomy.cdm.api.service.UpdateResult;
31
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
32
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
33
import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
34
import eu.etaxonomy.cdm.api.service.dto.FieldUnitDTO;
35
import eu.etaxonomy.cdm.api.service.dto.IdentifiedEntityDTO;
36
import eu.etaxonomy.cdm.api.service.dto.MarkedEntityDTO;
37
import eu.etaxonomy.cdm.api.service.dto.PreservedSpecimenDTO;
38
import eu.etaxonomy.cdm.api.service.pager.Pager;
39
import eu.etaxonomy.cdm.api.service.search.LuceneParseException;
40
import eu.etaxonomy.cdm.api.service.search.SearchResult;
41
import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
42
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
43
import eu.etaxonomy.cdm.model.common.Annotation;
44
import eu.etaxonomy.cdm.model.common.DefinedTerm;
45
import eu.etaxonomy.cdm.model.common.ICdmBase;
46
import eu.etaxonomy.cdm.model.common.ISourceable;
47
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
48
import eu.etaxonomy.cdm.model.common.LSID;
49
import eu.etaxonomy.cdm.model.common.Language;
50
import eu.etaxonomy.cdm.model.common.Marker;
51
import eu.etaxonomy.cdm.model.common.MarkerType;
52
import eu.etaxonomy.cdm.model.description.DescriptionBase;
53
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
54
import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
55
import eu.etaxonomy.cdm.model.location.Country;
56
import eu.etaxonomy.cdm.model.media.Media;
57
import eu.etaxonomy.cdm.model.media.Rights;
58
import eu.etaxonomy.cdm.model.molecular.DnaSample;
59
import eu.etaxonomy.cdm.model.molecular.Sequence;
60
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
61
import eu.etaxonomy.cdm.model.name.TaxonName;
62
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
14 63
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
64
import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
65
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
15 66
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
67
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
16 68
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
69
import eu.etaxonomy.cdm.model.taxon.Taxon;
70
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
71
import eu.etaxonomy.cdm.model.view.AuditEvent;
72
import eu.etaxonomy.cdm.model.view.AuditEventRecord;
73
import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
74
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
75
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
76
import eu.etaxonomy.cdm.persistence.query.Grouping;
77
import eu.etaxonomy.cdm.persistence.query.MatchMode;
78
import eu.etaxonomy.cdm.persistence.query.OrderHint;
79
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
80
import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
81
import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
17 82

  
18 83
/**
19 84
 *
......
23 88
 */
24 89
public class DerivedUnitConverterTest extends Assert {
25 90

  
91

  
26 92
    @Test
27 93
    public void toMediaSpecimen() throws DerivedUnitConversionException {
28 94
        DerivedUnit du = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
29 95
        du.setTitleCache("test derived unit", true);
30
        DerivedUnitConverter<MediaSpecimen> duc = new DerivedUnitConverter<MediaSpecimen>(du);
96
        DerivedUnitConverter<MediaSpecimen> duc = new DerivedUnitConverter<MediaSpecimen>(du, new OccurrenceServiceMock());
31 97
        MediaSpecimen target = duc.convertTo(MediaSpecimen.class, SpecimenOrObservationType.StillImage);
32 98
        assertNotNull(target);
33 99
        assertEquals(SpecimenOrObservationType.StillImage, target.getRecordBasis());
......
39 105

  
40 106
        MediaSpecimen du = MediaSpecimen.NewInstance(SpecimenOrObservationType.StillImage);
41 107
        du.setTitleCache("test media specimen", true);
42
        DerivedUnitConverter<DerivedUnit> duc = new DerivedUnitConverter<DerivedUnit>(du);
108
        DerivedUnitConverter<DerivedUnit> duc = new DerivedUnitConverter<DerivedUnit>(du, new OccurrenceServiceMock());
43 109
        DerivedUnit target = duc.convertTo(DerivedUnit.class, SpecimenOrObservationType.PreservedSpecimen);
44 110
        assertNotNull(target);
45 111
        assertEquals(SpecimenOrObservationType.PreservedSpecimen, target.getRecordBasis());
46 112
        assertEquals("test media specimen", target.getTitleCache());
47 113
    }
48 114

  
115
    class OccurrenceServiceMock implements IOccurrenceService {
116

  
117
        /**
118
         * {@inheritDoc}
119
         */
120
        @Override
121
        public void updateTitleCache() {
122

  
123

  
124
        }
125

  
126
        /**
127
         * {@inheritDoc}
128
         */
129
        @Override
130
        public void updateTitleCache(Class<? extends SpecimenOrObservationBase> clazz, Integer stepSize,
131
                IIdentifiableEntityCacheStrategy<SpecimenOrObservationBase> cacheStrategy, IProgressMonitor monitor) {
132

  
133

  
134
        }
135

  
136
        /**
137
         * {@inheritDoc}
138
         */
139
        @Override
140
        public SpecimenOrObservationBase find(LSID lsid) {
141

  
142
            return null;
143
        }
144

  
145
        /**
146
         * {@inheritDoc}
147
         */
148
        @Override
149
        public SpecimenOrObservationBase replace(SpecimenOrObservationBase x, SpecimenOrObservationBase y) {
150

  
151
            return null;
152
        }
153

  
154
        /**
155
         * {@inheritDoc}
156
         */
157
        @Override
158
        public Pager<IdentifiableSource> getSources(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber,
159
                List<String> propertyPaths) {
160

  
161
            return null;
162
        }
163

  
164
        /**
165
         * {@inheritDoc}
166
         */
167
        @Override
168
        public Pager<Rights> getRights(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber,
169
                List<String> propertyPaths) {
170

  
171
            return null;
172
        }
173

  
174
        /**
175
         * {@inheritDoc}
176
         */
177
        @Override
178
        public String getTitleCache(UUID uuid, boolean refresh) {
179

  
180
            return null;
181
        }
182

  
183
        /**
184
         * {@inheritDoc}
185
         */
186
        @Override
187
        public Pager<SpecimenOrObservationBase> findByTitle(Class<? extends SpecimenOrObservationBase> clazz,
188
                String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber,
189
                List<OrderHint> orderHints, List<String> propertyPaths) {
190

  
191
            return null;
192
        }
193

  
194
        /**
195
         * {@inheritDoc}
196
         */
197
        @Override
198
        public Pager<SpecimenOrObservationBase> findByTitle(
199
                IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator) {
200

  
201
            return null;
202
        }
203

  
204
        /**
205
         * {@inheritDoc}
206
         */
207
        @Override
208
        public Integer countByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString,
209
                MatchMode matchmode, List<Criterion> criteria) {
210

  
211
            return null;
212
        }
213

  
214
        /**
215
         * {@inheritDoc}
216
         */
217
        @Override
218
        public Integer countByTitle(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator) {
219

  
220
            return null;
221
        }
222

  
223
        /**
224
         * {@inheritDoc}
225
         */
226
        @Override
227
        public List<SpecimenOrObservationBase> listByTitle(Class<? extends SpecimenOrObservationBase> clazz,
228
                String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber,
229
                List<OrderHint> orderHints, List<String> propertyPaths) {
230

  
231
            return null;
232
        }
233

  
234
        /**
235
         * {@inheritDoc}
236
         */
237
        @Override
238
        public List<SpecimenOrObservationBase> listByReferenceTitle(Class<? extends SpecimenOrObservationBase> clazz,
239
                String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber,
240
                List<OrderHint> orderHints, List<String> propertyPaths) {
241

  
242
            return null;
243
        }
244

  
245
        /**
246
         * {@inheritDoc}
247
         */
248
        @Override
249
        public int deduplicate(Class<? extends SpecimenOrObservationBase> clazz, IMatchStrategy matchStrategy,
250
                IMergeStrategy mergeStrategy) {
251

  
252
            return 0;
253
        }
254

  
255
        /**
256
         * {@inheritDoc}
257
         */
258
        @Override
259
        public Pager<SpecimenOrObservationBase> findTitleCache(Class<? extends SpecimenOrObservationBase> clazz,
260
                String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints,
261
                MatchMode matchMode) {
262

  
263
            return null;
264
        }
265

  
266
        /**
267
         * {@inheritDoc}
268
         */
269
        @Override
270
        public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
271

  
272
            return null;
273
        }
274

  
275
        /**
276
         * {@inheritDoc}
277
         */
278
        @Override
279
        public <S extends SpecimenOrObservationBase> Pager<IdentifiedEntityDTO<S>> findByIdentifier(Class<S> clazz,
280
                String identifier, DefinedTerm identifierType, MatchMode matchmode, boolean includeCdmEntity,
281
                Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
282

  
283
            return null;
284
        }
285

  
286
        /**
287
         * {@inheritDoc}
288
         */
289
        @Override
290
        public <S extends SpecimenOrObservationBase> Pager<MarkedEntityDTO<S>> findByMarker(Class<S> clazz,
291
                MarkerType markerType, Boolean markerValue, boolean includeEntity, Integer pageSize, Integer pageNumber,
292
                List<String> propertyPaths) {
293

  
294
            return null;
295
        }
296

  
297
        /**
298
         * {@inheritDoc}
299
         */
300
        @Override
301
        public Pager<Annotation> getAnnotations(SpecimenOrObservationBase annotatedObj, MarkerType status,
302
                Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
303

  
304
            return null;
305
        }
306

  
307
        /**
308
         * {@inheritDoc}
309
         */
310
        @Override
311
        public Pager<Marker> getMarkers(SpecimenOrObservationBase annotatableEntity, Boolean technical,
312
                Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
313

  
314
            return null;
315
        }
316

  
317
        /**
318
         * {@inheritDoc}
319
         */
320
        @Override
321
        public List<Object[]> groupMarkers(Class<? extends SpecimenOrObservationBase> clazz, Boolean technical,
322
                Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
323

  
324
            return null;
325
        }
326

  
327
        /**
328
         * {@inheritDoc}
329
         */
330
        @Override
331
        public int countMarkers(Class<? extends SpecimenOrObservationBase> clazz, Boolean technical) {
332

  
333
            return 0;
334
        }
335

  
336
        /**
337
         * {@inheritDoc}
338
         */
339
        @Override
340
        public <S extends SpecimenOrObservationBase> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz,
341
                Integer limit, String pattern) {
342

  
343
            return null;
344
        }
345

  
346
        /**
347
         * {@inheritDoc}
348
         */
349
        @Override
350
        public List<UuidAndTitleCache<SpecimenOrObservationBase>> getUuidAndTitleCache(Integer limit, String pattern) {
351

  
352
            return null;
353
        }
354

  
355
        /**
356
         * {@inheritDoc}
357
         */
358
        @Override
359
        public Pager<AuditEventRecord<SpecimenOrObservationBase>> pageAuditEvents(SpecimenOrObservationBase t,
360
                Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
361

  
362
            return null;
363
        }
364

  
365
        /**
366
         * {@inheritDoc}
367
         */
368
        @Override
369
        public AuditEventRecord<SpecimenOrObservationBase> getNextAuditEvent(SpecimenOrObservationBase t) {
370

  
371
            return null;
372
        }
373

  
374
        /**
375
         * {@inheritDoc}
376
         */
377
        @Override
378
        public AuditEventRecord<SpecimenOrObservationBase> getPreviousAuditEvent(SpecimenOrObservationBase t) {
379

  
380
            return null;
381
        }
382

  
383
        /**
384
         * {@inheritDoc}
385
         */
386
        @Override
387
        public Pager<AuditEventRecord<SpecimenOrObservationBase>> pageAuditEvents(
388
                Class<? extends SpecimenOrObservationBase> clazz, AuditEvent from, AuditEvent to,
389
                List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort,
390
                List<String> propertyPaths) {
391

  
392
            return null;
393
        }
394

  
395
        /**
396
         * {@inheritDoc}
397
         */
398
        @Override
399
        public DeleteResult isDeletable(UUID object, DeleteConfiguratorBase config) {
400

  
401
            return null;
402
        }
403

  
404
        /**
405
         * {@inheritDoc}
406
         */
407
        @Override
408
        public void clear() {
409

  
410

  
411
        }
412

  
413
        /**
414
         * {@inheritDoc}
415
         */
416
        @Override
417
        public void lock(SpecimenOrObservationBase t, LockOptions lockOptions) {
418

  
419

  
420
        }
421

  
422
        /**
423
         * {@inheritDoc}
424
         */
425
        @Override
426
        public void refresh(SpecimenOrObservationBase t, LockOptions lockOptions, List<String> propertyPaths) {
427

  
428

  
429
        }
430

  
431
        /**
432
         * {@inheritDoc}
433
         */
434
        @Override
435
        public int count(Class<? extends SpecimenOrObservationBase> clazz) {
436

  
437
            return 0;
438
        }
439

  
440
        /**
441
         * {@inheritDoc}
442
         */
443
        @Override
444
        public DeleteResult delete(UUID persistentObjectUUID) {
445

  
446
            return null;
447
        }
448

  
449
        /**
450
         * {@inheritDoc}
451
         */
452
        @Override
453
        public boolean exists(UUID uuid) {
454

  
455
            return false;
456
        }
457

  
458
        /**
459
         * {@inheritDoc}
460
         */
461
        @Override
462
        public List<SpecimenOrObservationBase> find(Set<UUID> uuidSet) {
463

  
464
            return null;
465
        }
466

  
467
        /**
468
         * {@inheritDoc}
469
         */
470
        @Override
471
        public SpecimenOrObservationBase find(UUID uuid) {
472

  
473
            return null;
474
        }
475

  
476
        /**
477
         * {@inheritDoc}
478
         */
479
        @Override
480
        public SpecimenOrObservationBase findWithoutFlush(UUID uuid) {
481

  
482
            return null;
483
        }
484

  
485
        /**
486
         * {@inheritDoc}
487
         */
488
        @Override
489
        public SpecimenOrObservationBase find(int id) {
490

  
491
            return null;
492
        }
493

  
494
        /**
495
         * {@inheritDoc}
496
         */
497
        @Override
498
        public List<SpecimenOrObservationBase> findById(Set<Integer> idSet) {
499

  
500
            return null;
501
        }
502

  
503
        /**
504
         * {@inheritDoc}
505
         */
506
        @Override
507
        public Session getSession() {
508

  
509
            return null;
510
        }
511

  
512
        /**
513
         * {@inheritDoc}
514
         */
515
        @Override
516
        public List<Object[]> group(Class<? extends SpecimenOrObservationBase> clazz, Integer limit, Integer start,
517
                List<Grouping> groups, List<String> propertyPaths) {
518

  
519
            return null;
520
        }
521

  
522
        /**
523
         * {@inheritDoc}
524
         */
525
        @Override
526
        public <S extends SpecimenOrObservationBase> List<S> list(Class<S> type, Integer limit, Integer start,
527
                List<OrderHint> orderHints, List<String> propertyPaths) {
528

  
529
            return null;
530
        }
531

  
532
        /**
533
         * {@inheritDoc}
534
         */
535
        @Override
536
        public SpecimenOrObservationBase load(UUID uuid) {
537

  
538
            return null;
539
        }
540

  
541
        /**
542
         * {@inheritDoc}
543
         */
544
        @Override
545
        public SpecimenOrObservationBase load(int id, List<String> propertyPaths) {
546

  
547
            return null;
548
        }
549

  
550
        /**
551
         * {@inheritDoc}
552
         */
553
        @Override
554
        public SpecimenOrObservationBase load(UUID uuid, List<String> propertyPaths) {
555

  
556
            return null;
557
        }
558

  
559
        /**
560
         * {@inheritDoc}
561
         */
562
        @Override
563
        public List<SpecimenOrObservationBase> load(List<UUID> uuids, List<String> propertyPaths) {
564

  
565
            return null;
566
        }
567

  
568
        /**
569
         * {@inheritDoc}
570
         */
571
        @Override
572
        public SpecimenOrObservationBase merge(SpecimenOrObservationBase transientObject) {
573

  
574
            return null;
575
        }
576

  
577
        /**
578
         * {@inheritDoc}
579
         */
580
        @Override
581
        public <S extends SpecimenOrObservationBase> Pager<S> page(Class<S> type, Integer pageSize, Integer pageNumber,
582
                List<OrderHint> orderHints, List<String> propertyPaths) {
583

  
584
            return null;
585
        }
586

  
587
        /**
588
         * {@inheritDoc}
589
         */
590
        @Override
591
        public UUID refresh(SpecimenOrObservationBase persistentObject) {
592

  
593
            return null;
594
        }
595

  
596
        /**
597
         * {@inheritDoc}
598
         */
599
        @Override
600
        public List<SpecimenOrObservationBase> rows(String tableName, int limit, int start) {
601

  
602
            return null;
603
        }
604

  
605
        /**
606
         * {@inheritDoc}
607
         */
608
        @Override
609
        public Map<UUID, SpecimenOrObservationBase> save(Collection<SpecimenOrObservationBase> newInstances) {
610

  
611
            return null;
612
        }
613

  
614
        /**
615
         * {@inheritDoc}
616
         */
617
        @Override
618
        public SpecimenOrObservationBase save(SpecimenOrObservationBase newInstance) {
619

  
620
            return null;
621
        }
622

  
623
        /**
624
         * {@inheritDoc}
625
         */
626
        @Override
627
        public UUID saveOrUpdate(SpecimenOrObservationBase transientObject) {
628

  
629
            return null;
630
        }
631

  
632
        /**
633
         * {@inheritDoc}
634
         */
635
        @Override
636
        public Map<UUID, SpecimenOrObservationBase> saveOrUpdate(
637
                Collection<SpecimenOrObservationBase> transientObjects) {
638

  
639
            return null;
640
        }
641

  
642
        /**
643
         * {@inheritDoc}
644
         */
645
        @Override
646
        public UUID update(SpecimenOrObservationBase transientObject) {
647

  
648
            return null;
649
        }
650

  
651
        /**
652
         * {@inheritDoc}
653
         */
654
        @Override
655
        public SpecimenOrObservationBase loadWithUpdate(UUID uuid) {
656

  
657
            return null;
658
        }
659

  
660
        /**
661
         * {@inheritDoc}
662
         */
663
        @Override
664
        public List<SpecimenOrObservationBase> list(SpecimenOrObservationBase example, Set<String> includeProperties,
665
                Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
666

  
667
            return null;
668
        }
669

  
670
        /**
671
         * {@inheritDoc}
672
         */
673
        @Override
674
        public DeleteResult delete(SpecimenOrObservationBase persistentObject) {
675

  
676
            return null;
677
        }
678

  
679
        /**
680
         * {@inheritDoc}
681
         */
682
        @Override
683
        public DeleteResult delete(Collection<UUID> persistentObjectUUIDs) {
684

  
685
            return null;
686
        }
687

  
688
        /**
689
         * {@inheritDoc}
690
         */
691
        @Override
692
        public List<SpecimenOrObservationBase> merge(List<SpecimenOrObservationBase> detachedObjects) {
693

  
694
            return null;
695
        }
696

  
697
        /**
698
         * {@inheritDoc}
699
         */
700
        @Override
701
        public List<SpecimenOrObservationBase> loadByIds(List<Integer> idSet, List<String> propertyPaths) {
702

  
703
            return null;
704
        }
705

  
706
        /**
707
         * {@inheritDoc}
708
         */
709
        @Override
710
        public List<MergeResult<SpecimenOrObservationBase>> merge(List<SpecimenOrObservationBase> detachedObjects,
711
                boolean returnTransientEntity) {
712

  
713
            return null;
714
        }
715

  
716
        /**
717
         * {@inheritDoc}
718
         */
719
        @Override
720
        public MergeResult<SpecimenOrObservationBase> merge(SpecimenOrObservationBase newInstance,
721
                boolean returnTransientEntity) {
722

  
723
            return null;
724
        }
725

  
726
        /**
727
         * {@inheritDoc}
728
         */
729
        @Override
730
        public Country getCountryByIso(String iso639) {
731

  
732
            return null;
733
        }
734

  
735
        /**
736
         * {@inheritDoc}
737
         */
738
        @Override
739
        public List<Country> getCountryByName(String name) {
740

  
741
            return null;
742
        }
743

  
744
        /**
745
         * {@inheritDoc}
746
         */
747
        @Override
748
        public Pager<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type,
749
                TaxonBase determinedAs, Integer limit, Integer start, List<OrderHint> orderHints,
750
                List<String> propertyPaths) {
751

  
752
            return null;
753
        }
754

  
755
        /**
756
         * {@inheritDoc}
757
         */
758
        @Override
759
        public Pager<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type,
760
                TaxonName determinedAs, Integer limit, Integer start, List<OrderHint> orderHints,
761
                List<String> propertyPaths) {
762

  
763
            return null;
764
        }
765

  
766
        /**
767
         * {@inheritDoc}
768
         */
769
        @Override
770
        public Pager<Media> getMedia(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber,
771
                List<String> propertyPaths) {
772

  
773
            return null;
774
        }
775

  
776
        /**
777
         * {@inheritDoc}
778
         */
779
        @Override
780
        public Pager<Media> getMediainHierarchy(SpecimenOrObservationBase rootOccurence, Integer pageSize,
781
                Integer pageNumber, List<String> propertyPaths) {
782

  
783
            return null;
784
        }
785

  
786
        /**
787
         * {@inheritDoc}
788
         */
789
        @Override
790
        public int countDeterminations(SpecimenOrObservationBase occurence, TaxonBase taxonbase) {
791

  
792
            return 0;
793
        }
794

  
795
        /**
796
         * {@inheritDoc}
797
         */
798
        @Override
799
        public Pager<DeterminationEvent> getDeterminations(SpecimenOrObservationBase occurence, TaxonBase taxonBase,
800
                Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
801

  
802
            return null;
803
        }
804

  
805
        /**
806
         * {@inheritDoc}
807
         */
808
        @Override
809
        public Pager<DerivationEvent> getDerivationEvents(SpecimenOrObservationBase occurence, Integer pageSize,
810
                Integer pageNumber, List<String> propertyPaths) {
811

  
812
            return null;
813
        }
814

  
815
        /**
816
         * {@inheritDoc}
817
         */
818
        @Override
819
        public Pager<SpecimenOrObservationBase> search(Class<? extends SpecimenOrObservationBase> clazz, String query,
820
                Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
821

  
822
            return null;
823
        }
824

  
825
        /**
826
         * {@inheritDoc}
827
         */
828
        @Override
829
        public List<UuidAndTitleCache<FieldUnit>> getFieldUnitUuidAndTitleCache() {
830

  
831
            return null;
832
        }
833

  
834
        /**
835
         * {@inheritDoc}
836
         */
837
        @Override
838
        public List<UuidAndTitleCache<DerivedUnit>> getDerivedUnitUuidAndTitleCache(Integer limit, String pattern) {
839

  
840
            return null;
841
        }
842

  
843
        /**
844
         * {@inheritDoc}
845
         */
846
        @Override
847
        public DerivedUnitFacade getDerivedUnitFacade(DerivedUnit derivedUnit, List<String> propertyPaths)
848
                throws DerivedUnitFacadeNotSupportedException {
849

  
850
            return null;
851
        }
852

  
853
        /**
854
         * {@inheritDoc}
855
         */
856
        @Override
857
        public List<DerivedUnitFacade> listDerivedUnitFacades(DescriptionBase description, List<String> propertyPaths) {
858

  
859
            return null;
860
        }
861

  
862
        /**
863
         * {@inheritDoc}
864
         */
865
        @Override
866
        public <T extends SpecimenOrObservationBase> List<T> listByAssociatedTaxon(Class<T> type,
867
                Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth,
868
                Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
869

  
870
            return null;
871
        }
872

  
873
        /**
874
         * {@inheritDoc}
875
         */
876
        @Override
877
        public Collection<SpecimenOrObservationBase> listFieldUnitsByAssociatedTaxon(Taxon associatedTaxon,
878
                List<OrderHint> orderHints, List<String> propertyPaths) {
879

  
880
            return null;
881
        }
882

  
883
        /**
884
         * {@inheritDoc}
885
         */
886
        @Override
887
        public Pager<SpecimenOrObservationBase> pageFieldUnitsByAssociatedTaxon(
888
                Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth,
889
                Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
890

  
891
            return null;
892
        }
893

  
894
        /**
895
         * {@inheritDoc}
896
         */
897
        @Override
898
        public <T extends SpecimenOrObservationBase> Pager<T> pageByAssociatedTaxon(Class<T> type,
899
                Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth,
900
                Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
901

  
902
            return null;
903
        }
904

  
905
        /**
906
         * {@inheritDoc}
907
         */
908
        @Override
909
        public Collection<FieldUnit> getFieldUnits(UUID specimenUuid) {
910

  
911
            return null;
912
        }
913

  
914
        /**
915
         * {@inheritDoc}
916
         */
917
        @Override
918
        public Pager<SearchResult<SpecimenOrObservationBase>> findByFullText(
919
                Class<? extends SpecimenOrObservationBase> clazz, String queryString, Rectangle boundingBox,
920
                List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber,
921
                List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, LuceneParseException {
922

  
923
            return null;
924
        }
925

  
926
        /**
927
         * {@inheritDoc}
928
         */
929
        @Override
930
        public <T extends SpecimenOrObservationBase> Pager<T> pageByAssociatedTaxon(Class<T> type,
931
                Set<TaxonRelationshipEdge> includeRelationships, String taxonUUID, Integer maxDepth, Integer pageSize,
932
                Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
933

  
934
            return null;
935
        }
936

  
937
        /**
938
         * {@inheritDoc}
939
         */
940
        @Override
941
        public UpdateResult moveSequence(DnaSample from, DnaSample to, Sequence sequence) {
942

  
943
            return null;
944
        }
945

  
946
        /**
947
         * {@inheritDoc}
948
         */
949
        @Override
950
        public UpdateResult moveSequence(UUID fromUuid, UUID toUuid, UUID sequenceUuid) {
951

  
952
            return null;
953
        }
954

  
955
        /**
956
         * {@inheritDoc}
957
         */
958
        @Override
959
        public UpdateResult moveDerivate(UUID specimenFromUuid, UUID specimenToUuid, UUID derivateUuid) {
960

  
961
            return null;
962
        }
963

  
964
        /**
965
         * {@inheritDoc}
966
         */
967
        @Override
968
        public boolean moveDerivate(SpecimenOrObservationBase<?> from, SpecimenOrObservationBase<?> to,
969
                DerivedUnit derivate) {
970

  
971
            return false;
972
        }
973

  
974
        /**
975
         * {@inheritDoc}
976
         */
977
        @Override
978
        public FieldUnitDTO assembleFieldUnitDTO(FieldUnit fieldUnit, UUID associatedTaxonUuid) {
979

  
980
            return null;
981
        }
982

  
983
        /**
984
         * {@inheritDoc}
985
         */
986
        @Override
987
        public PreservedSpecimenDTO assemblePreservedSpecimenDTO(DerivedUnit derivedUnit) {
988

  
989
            return null;
990
        }
991

  
992
        /**
993
         * {@inheritDoc}
994
         */
995
        @Override
996
        public Collection<ICdmBase> getNonCascadedAssociatedElements(SpecimenOrObservationBase<?> specimen) {
997

  
998
            return null;
999
        }
1000

  
1001
        /**
1002
         * {@inheritDoc}
1003
         */
1004
        @Override
1005
        public DeleteResult delete(SpecimenOrObservationBase<?> specimen, SpecimenDeleteConfigurator config) {
1006

  
1007
            return null;
1008
        }
1009

  
1010
        /**
1011
         * {@inheritDoc}
1012
         */
1013
        @Override
1014
        public DeleteResult delete(UUID specimenUuid, SpecimenDeleteConfigurator config) {
1015

  
1016
            return null;
1017
        }
1018

  
1019
        /**
1020
         * {@inheritDoc}
1021
         */
1022
        @Override
1023
        public Collection<IndividualsAssociation> listIndividualsAssociations(SpecimenOrObservationBase<?> specimen,
1024
                Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
1025

  
1026
            return null;
1027
        }
1028

  
1029
        /**
1030
         * {@inheritDoc}
1031
         */
1032
        @Override
1033
        public Collection<TaxonBase<?>> listIndividualsAssociationTaxa(SpecimenOrObservationBase<?> specimen,
1034
                Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
1035

  
1036
            return null;
1037
        }
1038

  
1039
        /**
1040
         * {@inheritDoc}
1041
         */
1042
        @Override
1043
        public Collection<TaxonBase<?>> listAssociatedTaxa(SpecimenOrObservationBase<?> specimen, Integer limit,
1044
                Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
1045
            return null;
1046
        }
1047

  
1048
        /**
1049
         * {@inheritDoc}
1050
         */
1051
        @Override
1052
        public Collection<TaxonBase<?>> listDeterminedTaxa(SpecimenOrObservationBase<?> specimen, Integer limit,
1053
                Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
1054

  
1055
            return null;
1056
        }
1057

  
1058
        /**
1059
         * {@inheritDoc}
1060
         */
1061
        @Override
1062
        public Collection<DeterminationEvent> listDeterminationEvents(SpecimenOrObservationBase<?> specimen,
1063
                Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
1064
            return null;
1065
        }
1066

  
1067
        /**
1068
         * {@inheritDoc}
1069
         */
1070
        @Override
1071
        public Collection<TaxonBase<?>> listTypeDesignationTaxa(DerivedUnit specimen, Integer limit, Integer start,
1072
                List<OrderHint> orderHints, List<String> propertyPaths) {
1073

  
1074
            return null;
1075
        }
1076

  
1077
        /**
1078
         * {@inheritDoc}
1079
         */
1080
        @Override
1081
        public Map<DerivedUnit, Collection<SpecimenTypeDesignation>> listTypeDesignations(
1082
                Collection<DerivedUnit> specimens, Integer limit, Integer start, List<OrderHint> orderHints,
1083
                List<String> propertyPaths) {
1084
            return null;
1085
        }
1086

  
1087
        /**
1088
         * {@inheritDoc}
1089
         */
1090
        @Override
1091
        public Collection<SpecimenTypeDesignation> listTypeDesignations(DerivedUnit specimen, Integer limit,
1092
                Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
1093
            return null;
1094
        }
1095

  
1096
        /**
1097
         * {@inheritDoc}
1098
         */
1099
        @Override
1100
        public Collection<DescriptionBase<?>> listDescriptionsWithDescriptionSpecimen(
1101
                SpecimenOrObservationBase<?> specimen, Integer limit, Integer start, List<OrderHint> orderHints,
1102
                List<String> propertyPaths) {
1103

  
1104
            return null;
1105
        }
1106

  
1107
        /**
1108
         * {@inheritDoc}
1109
         */
1110
        @Override
1111
        public Collection<DescriptionElementBase> getCharacterDataForSpecimen(SpecimenOrObservationBase<?> specimen) {
1112

  
1113
            return null;
1114
        }
1115

  
1116
        /**
1117
         * {@inheritDoc}
1118
         */
1119
        @Override
1120
        public Collection<DescriptionElementBase> getCharacterDataForSpecimen(UUID specimenUuid) {
1121
            return null;
1122
        }
1123

  
1124
        /**
1125
         * {@inheritDoc}
1126
         */
1127
        @Override
1128
        public String getMostSignificantIdentifier(DerivedUnit derivedUnit) {
1129
            return null;
1130
        }
1131

  
1132
        /**
1133
         * {@inheritDoc}
1134
         */
1135
        @Override
1136
        public int countOccurrences(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> config) {
1137
            return 0;
1138
        }
1139

  
1140
        /**
1141
         * {@inheritDoc}
1142
         */
1143
        @Override
1144
        public List<SpecimenOrObservationBase<?>> getAllHierarchyDerivatives(SpecimenOrObservationBase<?> specimen) {
1145
            return null;
1146
        }
1147

  
1148
        /**
1149
         * {@inheritDoc}
1150
         */
1151
        @Override
1152
        public List<DerivedUnit> getAllChildDerivatives(SpecimenOrObservationBase<?> specimen) {
1153
            return null;
1154
        }
1155

  
1156
        /**
1157
         * {@inheritDoc}
1158
         */
1159
        @Override
1160
        public List<DerivedUnit> getAllChildDerivatives(UUID specimenUuid) {
1161
            return null;
1162
        }
1163

  
1164
    }
1165

  
1166

  
49 1167
}
cdmlib-test/src/main/resources/eu/etaxonomy/cdm/services_base_test.xml
52 52
            </set>
53 53
        </property>
54 54
    </bean>
55
    
56
    <!--  only needed as long as DerivedUnit and MediaSpecimen, ... are different classes -->
57
    <bean id="derivedUnitConverterFactory" class="eu.etaxonomy.cdm.api.utility.DerivedUnitConverterFactory" />
55 58
</beans>

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)