\r
import java.util.ArrayList;\r
import java.util.List;\r
-import java.util.Set;\r
import java.util.UUID;\r
\r
import org.springframework.beans.factory.annotation.Autowired;\r
import org.springframework.stereotype.Service;\r
+import org.springframework.transaction.annotation.Propagation;\r
import org.springframework.transaction.annotation.Transactional;\r
\r
import eu.etaxonomy.cdm.api.service.pager.Pager;\r
import eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl;\r
-import eu.etaxonomy.cdm.model.agent.Address;\r
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;\r
import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
import eu.etaxonomy.cdm.model.common.Language;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.cdm.model.common.VocabularyEnum;\r
import eu.etaxonomy.cdm.persistence.dao.common.ITermVocabularyDao;\r
import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;\r
\r
@Service\r
-@Transactional(readOnly = true)\r
+@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)\r
public class VocabularyServiceImpl extends IdentifiableServiceBase<TermVocabulary,ITermVocabularyDao> implements IVocabularyService {\r
\r
@Autowired\r
this.dao = dao;\r
}\r
\r
- public void generateTitleCache() {\r
- // TODO Auto-generated method stub\r
+\r
+ /* (non-Javadoc)\r
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy)\r
+ */\r
+ @Override\r
+ @Transactional(readOnly = false)\r
+ public void updateTitleCache(Class<? extends TermVocabulary> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<TermVocabulary> cacheStrategy, IProgressMonitor monitor) {\r
+ if (clazz == null){\r
+ clazz = TermVocabulary.class;\r
+ }\r
+ super.updateTitleCacheImpl(clazz, stepSize, cacheStrategy, monitor);\r
}\r
+\r
\r
public TermVocabulary<DefinedTermBase> getVocabulary(VocabularyEnum vocabularyType){\r
return dao.findByUuid(vocabularyType.getUuid());\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see eu.etaxonomy.cdm.api.service.IVocabularyService#listByTermClass(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)\r
+ */\r
+ @Override\r
public <TERM extends DefinedTermBase> List<TermVocabulary<TERM>> listByTermClass(Class<TERM> clazz, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {\r
- return dao.listByTermClass(clazz, limit, start, orderHints, propertyPaths);\r
+ boolean includeSubclasses = false;\r
+ boolean includeEmptyVocs = false;\r
+ return (List)listByTermClass(clazz, includeSubclasses, includeEmptyVocs, limit, start, orderHints, propertyPaths);\r
} \r
+\r
+ public <TERM extends DefinedTermBase> List<TermVocabulary<? extends TERM>> listByTermClass(Class<TERM> clazz, boolean includeSubclasses, boolean includeEmptyVocs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {\r
+ return dao.listByTermClass(clazz, includeSubclasses, includeEmptyVocs,limit, start, orderHints, propertyPaths);\r
+ }\r
\r
/** \r
* (non-Javadoc)\r
Integer numberOfResults = dao.countTerms(vocabulary);\r
\r
List<DefinedTermBase> results = new ArrayList<DefinedTermBase>();\r
- if(numberOfResults > 0) { // no point checking again\r
+ if(numberOfResults > 0) { // no point checking again //TODO use AbstractPagerImpl.hasResultsInRange(numberOfResults, pageNumber, pageSize)\r
results = dao.getTerms(vocabulary, pageSize, pageNumber,orderHints,propertyPaths); \r
}\r
\r
return new DefaultPagerImpl<DefinedTermBase>(pageNumber, numberOfResults, pageSize, results);\r
}\r
\r
+\r
+\r
}\r