Revision b227bf36
Added by Ben Clark over 15 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/TermVocabularyDaoImpl.java | ||
---|---|---|
81 | 81 |
} |
82 | 82 |
} |
83 | 83 |
|
84 |
public <T extends DefinedTermBase> TermVocabulary<T> findByUri(String termSourceUri, Class<T> clazz) { |
|
85 |
AuditEvent auditEvent = getAuditEventFromContext(); |
|
86 |
if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) { |
|
87 |
Query query = getSession().createQuery("select vocabulary from TermVocabulary vocabulary where vocabulary.termSourceUri= :termSourceUri"); |
|
88 |
query.setParameter("termSourceUri", termSourceUri); |
|
89 |
|
|
90 |
return (TermVocabulary<T>)query.uniqueResult(); |
|
91 |
} else { |
|
92 |
AuditQuery query = getAuditReader().createQuery().forEntitiesAtRevision(type,auditEvent.getRevisionNumber()); |
|
93 |
query.add(AuditEntity.property("termSourceUri").eq(termSourceUri)); |
|
94 |
|
|
95 |
return (TermVocabulary<T>)query.getSingleResult(); |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
84 | 99 |
|
85 | 100 |
} |
Also available in: Unified diff
Minor problems discovered whilst refactoring CATE:
Corrections to User / Group / Authority impl
Changes due to upgrade of hibernate-search