90b6096e41820aaaad4073bcd15d46b6a3ec07c5
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / dataimport / transientServices / TransientOccurenceService.java
1 // $Id$
2 /**
3 * Copyright (C) 2013 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.taxeditor.editor.view.dataimport.transientServices;
11
12 import java.io.IOException;
13 import java.util.Collection;
14 import java.util.HashSet;
15 import java.util.List;
16 import java.util.Map;
17 import java.util.Set;
18 import java.util.UUID;
19
20 import org.apache.lucene.index.CorruptIndexException;
21 import org.apache.lucene.queryParser.ParseException;
22 import org.hibernate.LockOptions;
23 import org.hibernate.Session;
24 import org.hibernate.criterion.Criterion;
25 import org.hibernate.envers.query.criteria.AuditCriterion;
26 import org.hibernate.search.spatial.impl.Rectangle;
27
28 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
29 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
30 import eu.etaxonomy.cdm.api.service.DeleteResult;
31 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
32 import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase;
33 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
34 import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator;
35 import eu.etaxonomy.cdm.api.service.dto.DerivateHierarchyDTO;
36 import eu.etaxonomy.cdm.api.service.pager.Pager;
37 import eu.etaxonomy.cdm.api.service.search.SearchResult;
38 import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
39 import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
40 import eu.etaxonomy.cdm.model.common.Annotation;
41 import eu.etaxonomy.cdm.model.common.ICdmBase;
42 import eu.etaxonomy.cdm.model.common.ISourceable;
43 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
44 import eu.etaxonomy.cdm.model.common.LSID;
45 import eu.etaxonomy.cdm.model.common.Language;
46 import eu.etaxonomy.cdm.model.common.Marker;
47 import eu.etaxonomy.cdm.model.common.MarkerType;
48 import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
49 import eu.etaxonomy.cdm.model.description.DescriptionBase;
50 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
51 import eu.etaxonomy.cdm.model.location.Country;
52 import eu.etaxonomy.cdm.model.media.Media;
53 import eu.etaxonomy.cdm.model.media.Rights;
54 import eu.etaxonomy.cdm.model.molecular.DnaSample;
55 import eu.etaxonomy.cdm.model.molecular.Sequence;
56 import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
57 import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
58 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
59 import eu.etaxonomy.cdm.model.occurrence.DeterminationEvent;
60 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
61 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
62 import eu.etaxonomy.cdm.model.taxon.Taxon;
63 import eu.etaxonomy.cdm.model.taxon.TaxonBase;
64 import eu.etaxonomy.cdm.model.view.AuditEvent;
65 import eu.etaxonomy.cdm.model.view.AuditEventRecord;
66 import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
67 import eu.etaxonomy.cdm.persistence.query.Grouping;
68 import eu.etaxonomy.cdm.persistence.query.MatchMode;
69 import eu.etaxonomy.cdm.persistence.query.OrderHint;
70 import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
71 import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
72 import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
73
74 /**
75 * @author pplitzner
76 * @date 26.09.2013
77 *
78 */
79 public class TransientOccurenceService implements IOccurrenceService {
80
81 private final IOccurrenceService defaultService;
82 private final Collection<SpecimenOrObservationBase<?>> units;
83
84 /**
85 * @param defaultService
86 */
87 public TransientOccurenceService(IOccurrenceService defaultService) {
88 this.defaultService = defaultService;
89 this.units = new HashSet<SpecimenOrObservationBase<?>>();
90 }
91
92 /**
93 * @param t
94 * @param pageSize
95 * @param pageNumber
96 * @param sort
97 * @param propertyPaths
98 * @return
99 * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
100 */
101 @Override
102 public Pager<AuditEventRecord<SpecimenOrObservationBase>> pageAuditEvents(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
103 return defaultService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
104 }
105
106 /**
107 * @param annotatedObj
108 * @param status
109 * @param pageSize
110 * @param pageNumber
111 * @param orderHints
112 * @param propertyPaths
113 * @return
114 * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
115 */
116 @Override
117 public Pager<Annotation> getAnnotations(SpecimenOrObservationBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
118 return defaultService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
119 }
120
121 /**
122 *
123 * @see eu.etaxonomy.cdm.api.service.IService#clear()
124 */
125 @Override
126 public void clear() {
127 defaultService.clear();
128 }
129
130 /**
131 * @param t
132 * @param lockMode
133 * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
134 */
135 @Override
136 public void lock(SpecimenOrObservationBase t, LockOptions lockOptions) {
137 defaultService.lock(t, lockOptions);
138 }
139
140 /**
141 * @param t
142 * @param lockMode
143 * @param propertyPaths
144 * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
145 */
146 @Override
147 public void refresh(SpecimenOrObservationBase t, LockOptions lockOptions, List<String> propertyPaths) {
148 defaultService.refresh(t, lockOptions, propertyPaths);
149 }
150
151 /**
152 *
153 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
154 */
155 @Override
156 public void updateTitleCache() {
157 defaultService.updateTitleCache();
158 }
159
160 /**
161 * @param t
162 * @return
163 * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
164 */
165 @Override
166 public AuditEventRecord<SpecimenOrObservationBase> getNextAuditEvent(SpecimenOrObservationBase t) {
167 return defaultService.getNextAuditEvent(t);
168 }
169
170 /**
171 * @param annotatableEntity
172 * @param technical
173 * @param pageSize
174 * @param pageNumber
175 * @param orderHints
176 * @param propertyPaths
177 * @return
178 * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
179 */
180 @Override
181 public Pager<Marker> getMarkers(SpecimenOrObservationBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
182 return defaultService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
183 }
184
185 /**
186 * @param clazz
187 * @param stepSize
188 * @param cacheStrategy
189 * @param monitor
190 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
191 */
192 @Override
193 public void updateTitleCache(Class<? extends SpecimenOrObservationBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<SpecimenOrObservationBase> cacheStrategy, IProgressMonitor monitor) {
194 defaultService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
195 }
196
197 /**
198 * @param t
199 * @return
200 * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
201 */
202 @Override
203 public AuditEventRecord<SpecimenOrObservationBase> getPreviousAuditEvent(SpecimenOrObservationBase t) {
204 return defaultService.getPreviousAuditEvent(t);
205 }
206
207 /**
208 * @param iso639
209 * @return
210 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getCountryByIso(java.lang.String)
211 */
212 @Override
213 public Country getCountryByIso(String iso639) {
214 return defaultService.getCountryByIso(iso639);
215 }
216
217 /**
218 * @param clazz
219 * @return
220 * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
221 */
222 @Override
223 public int count(Class<? extends SpecimenOrObservationBase> clazz) {
224 return defaultService.count(clazz);
225 }
226
227 /**
228 * @param name
229 * @return
230 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getCountryByName(java.lang.String)
231 */
232 @Override
233 public List<Country> getCountryByName(String name) {
234 return defaultService.getCountryByName(name);
235 }
236
237 /**
238 * @param type
239 * @param determinedAs
240 * @param limit
241 * @param start
242 * @param orderHints
243 * @param propertyPaths
244 * @return
245 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#list(java.lang.Class, eu.etaxonomy.cdm.model.taxon.TaxonBase, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
246 */
247 @Override
248 public Pager<SpecimenOrObservationBase> list(Class<? extends SpecimenOrObservationBase> type, TaxonBase determinedAs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
249 return defaultService.list(type, determinedAs, limit, start, orderHints, propertyPaths);
250 }
251
252 /**
253 * @param clazz
254 * @param from
255 * @param to
256 * @param criteria
257 * @param pageSize
258 * @param pageValue
259 * @param sort
260 * @param propertyPaths
261 * @return
262 * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
263 */
264 @Override
265 public Pager<AuditEventRecord<SpecimenOrObservationBase>> pageAuditEvents(Class<? extends SpecimenOrObservationBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
266 return defaultService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
267 }
268
269 /**
270 * @param lsid
271 * @return
272 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
273 */
274 @Override
275 public SpecimenOrObservationBase find(LSID lsid) {
276 return defaultService.find(lsid);
277 }
278
279 /**
280 * @param persistentObject
281 * @return
282 * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
283 */
284 @Override
285 public DeleteResult delete(SpecimenOrObservationBase persistentObject) {
286 return defaultService.delete(persistentObject);
287 }
288
289 /**
290 * @param clazz
291 * @param technical
292 * @param pageSize
293 * @param pageNumber
294 * @param propertyPaths
295 * @return
296 * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
297 */
298 @Override
299 public List<Object[]> groupMarkers(Class<? extends SpecimenOrObservationBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
300 return defaultService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
301 }
302
303 /**
304 * @param uuid
305 * @return
306 * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
307 */
308 @Override
309 public boolean exists(UUID uuid) {
310 return defaultService.exists(uuid);
311 }
312
313 /**
314 * @param x
315 * @param y
316 * @return
317 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
318 */
319 @Override
320 public SpecimenOrObservationBase replace(SpecimenOrObservationBase x, SpecimenOrObservationBase y) {
321 return defaultService.replace(x, y);
322 }
323
324 /**
325 * @param uuidSet
326 * @return
327 * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
328 */
329 @Override
330 public List<SpecimenOrObservationBase> find(Set<UUID> uuidSet) {
331 return defaultService.find(uuidSet);
332 }
333
334 /**
335 * @param t
336 * @param pageSize
337 * @param pageNumber
338 * @param propertyPaths
339 * @return
340 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
341 */
342 @Override
343 public Pager<IdentifiableSource> getSources(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
344 return defaultService.getSources(t, pageSize, pageNumber, propertyPaths);
345 }
346
347 /**
348 * @param uuid
349 * @return
350 * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
351 */
352 @Override
353 public SpecimenOrObservationBase find(UUID uuid) {
354 return defaultService.find(uuid);
355 }
356
357 /**
358 * @param id
359 * @return
360 * @see eu.etaxonomy.cdm.api.service.IService#find(int)
361 */
362 @Override
363 public SpecimenOrObservationBase find(int id) {
364 return defaultService.find(id);
365 }
366
367 /**
368 * @param t
369 * @param pageSize
370 * @param pageNumber
371 * @param propertyPaths
372 * @return
373 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
374 */
375 @Override
376 public Pager<Rights> getRights(SpecimenOrObservationBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
377 return defaultService.getRights(t, pageSize, pageNumber, propertyPaths);
378 }
379
380 /**
381 * @param clazz
382 * @param technical
383 * @return
384 * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
385 */
386 @Override
387 public int countMarkers(Class<? extends SpecimenOrObservationBase> clazz, Boolean technical) {
388 return defaultService.countMarkers(clazz, technical);
389 }
390
391 /**
392 * @param occurence
393 * @param pageSize
394 * @param pageNumber
395 * @param propertyPaths
396 * @return
397 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getMedia(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, java.lang.Integer, java.lang.Integer, java.util.List)
398 */
399 @Override
400 public Pager<Media> getMedia(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
401 return defaultService.getMedia(occurence, pageSize, pageNumber, propertyPaths);
402 }
403
404 /**
405 * @param idSet
406 * @return
407 * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
408 */
409 @Override
410 public List<SpecimenOrObservationBase> findById(Set<Integer> idSet) {
411 return defaultService.findById(idSet);
412 }
413
414 /**
415 * @param clazz
416 * @param idInSource
417 * @param idNamespace
418 * @return
419 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
420 */
421 @Override
422 public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
423 return defaultService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
424 }
425
426 /**
427 * @return
428 * @see eu.etaxonomy.cdm.api.service.IService#getSession()
429 */
430 @Override
431 public Session getSession() {
432 return defaultService.getSession();
433 }
434
435 /**
436 * @return
437 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
438 */
439 @Override
440 public List<UuidAndTitleCache<SpecimenOrObservationBase>> getUuidAndTitleCache() {
441 return defaultService.getUuidAndTitleCache();
442 }
443
444 /**
445 * @param clazz
446 * @param limit
447 * @param start
448 * @param groups
449 * @param propertyPaths
450 * @return
451 * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
452 */
453 @Override
454 public List<Object[]> group(Class<? extends SpecimenOrObservationBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
455 return defaultService.group(clazz, limit, start, groups, propertyPaths);
456 }
457
458 /**
459 * @param occurence
460 * @param taxonBase
461 * @param pageSize
462 * @param pageNumber
463 * @param propertyPaths
464 * @return
465 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDeterminations(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.taxon.TaxonBase, java.lang.Integer, java.lang.Integer, java.util.List)
466 */
467 @Override
468 public Pager<DeterminationEvent> getDeterminations(SpecimenOrObservationBase occurence, TaxonBase taxonBase, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
469 return defaultService.getDeterminations(occurence, taxonBase, pageSize, pageNumber, propertyPaths);
470 }
471
472 /**
473 * @param clazz
474 * @param queryString
475 * @param matchmode
476 * @param criteria
477 * @param pageSize
478 * @param pageNumber
479 * @param orderHints
480 * @param propertyPaths
481 * @return
482 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
483 */
484 @Override
485 public Pager<SpecimenOrObservationBase> findByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
486 return defaultService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
487 }
488
489 /**
490 * @param occurence
491 * @param pageSize
492 * @param pageNumber
493 * @param propertyPaths
494 * @return
495 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDerivationEvents(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, java.lang.Integer, java.lang.Integer, java.util.List)
496 */
497 @Override
498 public Pager<DerivationEvent> getDerivationEvents(SpecimenOrObservationBase occurence, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
499 return defaultService.getDerivationEvents(occurence, pageSize, pageNumber, propertyPaths);
500 }
501
502 /**
503 * @param type
504 * @param limit
505 * @param start
506 * @param orderHints
507 * @param propertyPaths
508 * @return
509 * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
510 */
511 @Override
512 public <S extends SpecimenOrObservationBase> List<S> list(Class<S> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
513 return defaultService.list(type, limit, start, orderHints, propertyPaths);
514 }
515
516 /**
517 * @param clazz
518 * @param query
519 * @param pageSize
520 * @param pageNumber
521 * @param orderHints
522 * @param propertyPaths
523 * @return
524 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
525 */
526 @Override
527 public Pager<SpecimenOrObservationBase> search(Class<? extends SpecimenOrObservationBase> clazz, String query, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
528 return defaultService.search(clazz, query, pageSize, pageNumber, orderHints, propertyPaths);
529 }
530
531 /**
532 * @param configurator
533 * @return
534 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
535 */
536 @Override
537 public Pager<SpecimenOrObservationBase> findByTitle(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator) {
538 return defaultService.findByTitle(configurator);
539 }
540
541 /**
542 * @param clazz
543 * @param queryString
544 * @param matchmode
545 * @param criteria
546 * @return
547 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
548 */
549 @Override
550 public Integer countByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
551 return defaultService.countByTitle(clazz, queryString, matchmode, criteria);
552 }
553
554 /**
555 * @param uuid
556 * @return
557 * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
558 */
559 @Override
560 public SpecimenOrObservationBase load(UUID uuid) {
561 return defaultService.load(uuid);
562 }
563
564 /**
565 * @param uuid
566 * @param propertyPaths
567 * @return
568 * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
569 */
570 @Override
571 public SpecimenOrObservationBase load(UUID uuid, List<String> propertyPaths) {
572 return defaultService.load(uuid, propertyPaths);
573 }
574
575 /**
576 * @param configurator
577 * @return
578 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
579 */
580 @Override
581 public Integer countByTitle(IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase> configurator) {
582 return defaultService.countByTitle(configurator);
583 }
584
585 /**
586 * @return
587 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getFieldUnitUuidAndTitleCache()
588 */
589 @Override
590 public List<UuidAndTitleCache<FieldUnit>> getFieldUnitUuidAndTitleCache() {
591 return defaultService.getFieldUnitUuidAndTitleCache();
592 }
593
594 /**
595 * @return
596 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDerivedUnitUuidAndTitleCache()
597 */
598 @Override
599 public List<UuidAndTitleCache<DerivedUnit>> getDerivedUnitUuidAndTitleCache() {
600 return defaultService.getDerivedUnitUuidAndTitleCache();
601 }
602
603 /**
604 * @param transientObject
605 * @return
606 * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
607 */
608 @Override
609 public SpecimenOrObservationBase merge(SpecimenOrObservationBase transientObject) {
610 return defaultService.merge(transientObject);
611 }
612
613 /**
614 * @param derivedUnit
615 * @param propertyPaths
616 * @return
617 * @throws DerivedUnitFacadeNotSupportedException
618 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getDerivedUnitFacade(eu.etaxonomy.cdm.model.occurrence.DerivedUnit, java.util.List)
619 */
620 @Override
621 public DerivedUnitFacade getDerivedUnitFacade(DerivedUnit derivedUnit, List<String> propertyPaths) throws DerivedUnitFacadeNotSupportedException {
622 return defaultService.getDerivedUnitFacade(derivedUnit, propertyPaths);
623 }
624
625 /**
626 * @param clazz
627 * @param queryString
628 * @param matchmode
629 * @param criteria
630 * @param pageSize
631 * @param pageNumber
632 * @param orderHints
633 * @param propertyPaths
634 * @return
635 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
636 */
637 @Override
638 public List<SpecimenOrObservationBase> listByTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
639 return defaultService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
640 }
641
642 /**
643 * @param description
644 * @param propertyPaths
645 * @return
646 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listDerivedUnitFacades(eu.etaxonomy.cdm.model.description.DescriptionBase, java.util.List)
647 */
648 @Override
649 public List<DerivedUnitFacade> listDerivedUnitFacades(DescriptionBase description, List<String> propertyPaths) {
650 return defaultService.listDerivedUnitFacades(description, propertyPaths);
651 }
652
653 /**
654 * @param type
655 * @param pageSize
656 * @param pageNumber
657 * @param orderHints
658 * @param propertyPaths
659 * @return
660 * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
661 */
662 @Override
663 public <S extends SpecimenOrObservationBase> Pager<S> page(Class<S> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
664 return defaultService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
665 }
666
667 /**
668 * @param type
669 * @param includeRelationships
670 * @param associatedTaxon
671 * @param maxDepth
672 * @param pageSize
673 * @param pageNumber
674 * @param orderHints
675 * @param propertyPaths
676 * @return
677 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listByAssociatedTaxon(java.lang.Class, java.util.Set, eu.etaxonomy.cdm.model.taxon.Taxon, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
678 */
679 @Override
680 public <T extends SpecimenOrObservationBase> List<T> listByAssociatedTaxon(Class<T> type, Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
681 return defaultService.listByAssociatedTaxon(type, includeRelationships, associatedTaxon, maxDepth, pageSize, pageNumber, orderHints, propertyPaths);
682 }
683
684 /**
685 * @param persistentObject
686 * @return
687 * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
688 */
689 @Override
690 public UUID refresh(SpecimenOrObservationBase persistentObject) {
691 return defaultService.refresh(persistentObject);
692 }
693
694 /**
695 * @param clazz
696 * @param queryString
697 * @param matchmode
698 * @param criteria
699 * @param pageSize
700 * @param pageNumber
701 * @param orderHints
702 * @param propertyPaths
703 * @return
704 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
705 */
706 @Override
707 public List<SpecimenOrObservationBase> listByReferenceTitle(Class<? extends SpecimenOrObservationBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
708 return defaultService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
709 }
710
711 /**
712 * @param tableName
713 * @param limit
714 * @param start
715 * @return
716 * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
717 */
718 @Override
719 public List<SpecimenOrObservationBase> rows(String tableName, int limit, int start) {
720 return defaultService.rows(tableName, limit, start);
721 }
722
723 /**
724 * @param newInstances
725 * @return
726 * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
727 */
728 @Override
729 public Map<UUID, SpecimenOrObservationBase> save(Collection<SpecimenOrObservationBase> newInstances) {
730 for(SpecimenOrObservationBase unit:newInstances){
731 save(unit);
732 }
733 return null;
734 }
735
736 /**
737 * @param type
738 * @param includeRelationships
739 * @param associatedTaxon
740 * @param maxDepth
741 * @param pageSize
742 * @param pageNumber
743 * @param orderHints
744 * @param propertyPaths
745 * @return
746 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#pageByAssociatedTaxon(java.lang.Class, java.util.Set, eu.etaxonomy.cdm.model.taxon.Taxon, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
747 */
748 @Override
749 public <T extends SpecimenOrObservationBase> Pager<T> pageByAssociatedTaxon(Class<T> type, Set<TaxonRelationshipEdge> includeRelationships, Taxon associatedTaxon, Integer maxDepth, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
750 return defaultService.pageByAssociatedTaxon(type, includeRelationships, associatedTaxon, maxDepth, pageSize, pageNumber, orderHints, propertyPaths);
751 }
752
753 /**
754 * @param newInstance
755 * @return
756 * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
757 */
758 @Override
759 public UUID save(SpecimenOrObservationBase newInstance) {
760 units.add(newInstance);
761 return null;
762 }
763
764 /**
765 * @param transientObject
766 * @return
767 * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
768 */
769 @Override
770 public UUID saveOrUpdate(SpecimenOrObservationBase transientObject) {
771 units.add(transientObject);
772 return null;
773 }
774
775 /**
776 * @param transientObjects
777 * @return
778 * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
779 */
780 @Override
781 public Map<UUID, SpecimenOrObservationBase> saveOrUpdate(Collection<SpecimenOrObservationBase> transientObjects) {
782 for(SpecimenOrObservationBase unit:transientObjects){
783 saveOrUpdate(unit);
784 }
785 return null;
786 }
787
788 /**
789 * @param clazz
790 * @param queryString
791 * @param boundingBox
792 * @param languages
793 * @param highlightFragments
794 * @param pageSize
795 * @param pageNumber
796 * @param orderHints
797 * @param propertyPaths
798 * @return
799 * @throws CorruptIndexException
800 * @throws IOException
801 * @throws ParseException
802 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#findByFullText(java.lang.Class, java.lang.String, org.hibernate.search.spatial.impl.Rectangle, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
803 */
804 @Override
805 public Pager<SearchResult<SpecimenOrObservationBase>> findByFullText(Class<? extends SpecimenOrObservationBase> clazz, String queryString, Rectangle boundingBox, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException {
806 return defaultService.findByFullText(clazz, queryString, boundingBox, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
807 }
808
809 /**
810 * @param transientObject
811 * @return
812 * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
813 */
814 @Override
815 public UUID update(SpecimenOrObservationBase transientObject) {
816 return defaultService.update(transientObject);
817 }
818
819 /**
820 * @param example
821 * @param includeProperties
822 * @param limit
823 * @param start
824 * @param orderHints
825 * @param propertyPaths
826 * @return
827 * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
828 */
829 @Override
830 public List<SpecimenOrObservationBase> list(SpecimenOrObservationBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
831 return defaultService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
832 }
833
834 /**
835 * @param clazz
836 * @param matchStrategy
837 * @param mergeStrategy
838 * @return
839 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
840 */
841 @Override
842 public int deduplicate(Class<? extends SpecimenOrObservationBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
843 return defaultService.deduplicate(clazz, matchStrategy, mergeStrategy);
844 }
845
846 /**
847 * @param clazz
848 * @param queryString
849 * @param pageSize
850 * @param pageNumber
851 * @param orderHints
852 * @param matchMode
853 * @return
854 * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
855 */
856 @Override
857 public Pager<SpecimenOrObservationBase> findTitleCache(Class<? extends SpecimenOrObservationBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
858 return defaultService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
859 }
860
861 /**
862 * @return
863 */
864 public Collection<SpecimenOrObservationBase<?>> getUnits() {
865 return units;
866 }
867
868 /* (non-Javadoc)
869 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getFieldUnits(java.util.UUID)
870 */
871 @Override
872 public Collection<FieldUnit> getFieldUnits(UUID derivedUnitUuid) {
873 return defaultService.getFieldUnits(derivedUnitUuid);
874 }
875
876 /* (non-Javadoc)
877 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#pageByAssociatedTaxon(java.lang.Class, java.util.Set, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
878 */
879 @Override
880 public <T extends SpecimenOrObservationBase> Pager<T> pageByAssociatedTaxon(Class<T> type,
881 Set<TaxonRelationshipEdge> includeRelationships, String taxonUUID, Integer maxDepth, Integer pageSize,
882 Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
883 return defaultService.pageByAssociatedTaxon(type, includeRelationships, taxonUUID,
884 maxDepth, pageSize, pageNumber, orderHints, propertyPaths);
885 }
886
887 /* (non-Javadoc)
888 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveDerivate(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.occurrence.DerivedUnit)
889 */
890 @Override
891 public boolean moveDerivate(SpecimenOrObservationBase<?> from, SpecimenOrObservationBase<?> to, DerivedUnit derivate) {
892 return defaultService.moveDerivate(from, to, derivate);
893 }
894
895 /* (non-Javadoc)
896 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#moveSequence(eu.etaxonomy.cdm.model.molecular.DnaSample, eu.etaxonomy.cdm.model.molecular.DnaSample, eu.etaxonomy.cdm.model.molecular.Sequence)
897 */
898 @Override
899 public boolean moveSequence(DnaSample from, DnaSample to, Sequence sequence) {
900 return defaultService.moveSequence(from, to, sequence);
901 }
902
903 @Override
904 public DeleteResult isDeletable(SpecimenOrObservationBase object,
905 DeleteConfiguratorBase config) {
906 return defaultService.isDeletable(object, config);
907 }
908
909 /* (non-Javadoc)
910 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#countDeterminations(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.model.taxon.TaxonBase)
911 */
912 @Override
913 public int countDeterminations(SpecimenOrObservationBase occurence, TaxonBase taxonbase) {
914 return defaultService.countDeterminations(occurence, taxonbase);
915 }
916
917 @Override
918 public SpecimenOrObservationBase findWithoutFlush(UUID uuid) {
919 return defaultService.findWithoutFlush(uuid);
920 }
921
922 /* (non-Javadoc)
923 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listFieldUnitsByAssociatedTaxon(java.util.Set, eu.etaxonomy.cdm.model.taxon.Taxon, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
924 */
925 @Override
926 public Collection<FieldUnit> listFieldUnitsByAssociatedTaxon(Set<TaxonRelationshipEdge> includeRelationships,
927 Taxon associatedTaxon, Integer maxDepth, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints,
928 List<String> propertyPaths) {
929 return defaultService.listFieldUnitsByAssociatedTaxon(includeRelationships, associatedTaxon, maxDepth, pageSize, pageNumber, orderHints, propertyPaths);
930 }
931
932 /* (non-Javadoc)
933 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#assembleDerivateHierarchyDTO(eu.etaxonomy.cdm.model.occurrence.FieldUnit, java.util.UUID)
934 */
935 @Override
936 public DerivateHierarchyDTO assembleDerivateHierarchyDTO(FieldUnit fieldUnit, UUID associatedTaxonUuid) {
937 return defaultService.assembleDerivateHierarchyDTO(fieldUnit, associatedTaxonUuid);
938 }
939
940 /* (non-Javadoc)
941 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#getNonCascadedAssociatedElements(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.api.conversation.ConversationHolder)
942 */
943 @Override
944 public Collection<ICdmBase> getNonCascadedAssociatedElements(SpecimenOrObservationBase<?> specimen) {
945 return defaultService.getNonCascadedAssociatedElements(specimen);
946 }
947
948 /* (non-Javadoc)
949 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#deleteDerivateHierarchy(eu.etaxonomy.cdm.model.common.ICdmBase)
950 */
951 @Override
952 public DeleteResult deleteDerivateHierarchy(ICdmBase from, SpecimenDeleteConfigurator config) {
953 return defaultService.deleteDerivateHierarchy(from, config);
954 }
955
956 /* (non-Javadoc)
957 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#delete(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator)
958 */
959 @Override
960 public DeleteResult delete(SpecimenOrObservationBase<?> specimen, SpecimenDeleteConfigurator config) {
961 return defaultService.delete(specimen, config);
962 }
963
964 /* (non-Javadoc)
965 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listIndividualsAssociations(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
966 */
967 @Override
968 public Collection<IndividualsAssociation> listIndividualsAssociations(SpecimenOrObservationBase<?> specimen,
969 Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
970 return defaultService.listIndividualsAssociations(specimen, limit, start, orderHints, propertyPaths);
971 }
972
973 /* (non-Javadoc)
974 * @see eu.etaxonomy.cdm.api.service.IOccurrenceService#listTypeDesignations(eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
975 */
976 @Override
977 public Collection<SpecimenTypeDesignation> listTypeDesignations(SpecimenOrObservationBase<?> specimen,
978 Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
979 return defaultService.listTypeDesignations(specimen, limit, start, orderHints, propertyPaths);
980 }
981
982 }