updated CDMServer and corresponding test files to use dbunit datasets with the possib...
[taxeditor.git] / eu.etaxonomy.taxeditor.remoting / src / main / java / eu / etaxonomy / cdm / api / cache / CdmServiceCacher.java
1 package eu.etaxonomy.cdm.api.cache;
2
3 import java.util.UUID;
4
5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Component;
7
8 import eu.etaxonomy.cdm.api.cache.CdmCacher;
9 import eu.etaxonomy.cdm.api.service.ITermService;
10 import eu.etaxonomy.cdm.model.common.CdmBase;
11
12 /**
13 * Class which uses CDM services to cache cdm entities
14 *
15 * FIXME: Currently only handles terms entities. It would be
16 * interesting to have a generic method which finds the
17 * correct service to load / cache the entity.
18 *
19 * @author cmathew
20 *
21 * @param <T>
22 */
23
24 public class CdmServiceCacher<T extends CdmBase> extends CdmCacher<T> {
25
26 @Autowired
27 ITermService termService;
28
29 @Override
30 protected T findByUuid(UUID uuid) {
31 T term = (T)termService.findWithoutFlush(uuid);
32 return term;
33 }
34
35 }