private static final Logger logger = Logger.getLogger(DefinedTermDaoImpl.class);
- public DefinedTermDaoImpl() {
+ @SuppressWarnings("unchecked")
+ public DefinedTermDaoImpl() {
super(DefinedTermBase.class);
indexedClasses = new Class[25];
indexedClasses[0] = Rank.class;
String queryStr;
if (isIso639_1){
- queryStr = "from Language where iso639_1 = :isoCode";
+ queryStr = "FROM Language WHERE iso639_1 = :isoCode";
}else{
- queryStr = "from Language where idInVocabulary = :isoCode and vocabulary.uuid = :vocUuid";
+ queryStr = "FROM Language WHERE idInVocabulary = :isoCode AND vocabulary.uuid = :vocUuid";
}
AuditEvent auditEvent = getAuditEventFromContext();
if(auditEvent.equals(AuditEvent.CURRENT_VIEW)) {
*/
@Override
public List<Language> getLanguagesByIso(List<String> iso639List) {
- List<Language> languages = new ArrayList<Language>(iso639List.size());
+ List<Language> languages = new ArrayList<>(iso639List.size());
for (String iso639 : iso639List) {
languages.add(getLanguageByIso(iso639));
}
@Override
public List<Language> getLanguagesByLocale(Enumeration<Locale> locales) {
- List<Language> languages = new ArrayList<Language>();
+ List<Language> languages = new ArrayList<>();
while(locales.hasMoreElements()) {
Locale locale = locales.nextElement();
languages.add(getLanguageByIso(locale.getLanguage()));
@Override
public List<Media> getMedia(DefinedTermBase definedTerm, Integer pageSize, Integer pageNumber) {
checkNotInPriorView("DefinedTermDaoImpl.getMedia(DefinedTermBase definedTerm, Integer pageSize, Integer pageNumber)");
- Query query = getSession().createQuery("select media from DefinedTermBase definedTerm join definedTerm.media media where definedTerm = :definedTerm");
+ Query query = getSession().createQuery(
+ "SELECT media "
+ + " FROM DefinedTermBase definedTerm "
+ + " JOIN definedTerm.media media "
+ + " WHERE definedTerm = :definedTerm");
query.setParameter("definedTerm", definedTerm);
addPageSizeAndNumber(query, pageSize, pageNumber);
defaultBeanInitializer.initializeAll(results, propertyPaths);
return results;
} else {
- List<T> result = new ArrayList<T>();
+ List<T> result = new ArrayList<>();
for(T t : partOf) {
AuditQuery query = makeAuditQuery(DefinedTermBase.class, auditEvent);
query.add(AuditEntity.relatedId("partOf").eq(t.getId()));
+ " where a.termType = :termType ";
Query query = getSession().createQuery(queryString);
- if(termType!=null){
- query.setParameter("termType", termType);
- }
+ query.setParameter("termType", termType);
@SuppressWarnings("unchecked")
List<Object[]> result = query.list();
}
}
Reference nomRef = name.getNomenclaturalReference();
+
//authors
IParsedMatchStrategy authorMatcher = MatchStrategyFactory.NewParsedTeamOrPersonInstance();
if (name.getCombinationAuthorship()!= null && !name.getCombinationAuthorship().isPersited()){
}
private <M extends IMatchable> M findBestMatching(M matchable, List<M> matchingList,
- IMatchStrategy referenceMatcher) {
+ IMatchStrategy matcher) {
// FIXME TODO resolve multiple duplications. Use first match for a start
if(matchingList.isEmpty()){
return null;
M bestMatching = matchingList.iterator().next();
return bestMatching;
}
-
-
-
}
\ No newline at end of file
}
public void addTypes(String typeStatus, List<String> typedTaxa){
if(types==null){
- types = new HashMap<String, List<String>>();
+ types = new HashMap<>();
}
types.put(typeStatus, typedTaxa);
}
public void setPreferredStableUri(URI preferredStableUri) {
this.preferredStableUri = preferredStableUri;
}
-
public URI getPreferredStableUri() {
return preferredStableUri;
}
+
public String getSpecimenShortTitle() {
return specimenShortTitle;
}
public void setSpecimenShortTitle(String specimenIdentifier) {
this.specimenShortTitle = specimenIdentifier;
}
+
public String getMostSignificantIdentifier() {
return mostSignificantIdentifier;
}
public void setMostSignificantIdentifier(String mostSignificantIdentifier) {
this.mostSignificantIdentifier = mostSignificantIdentifier;
}
+
public TypedEntityReference<TaxonName> getStoredUnder() {
return storedUnder;
}
public void setOriginalLabelInfo(String originalLabelInfo) {
this.originalLabelInfo = originalLabelInfo;
}
+
public String getExsiccatum() {
return exsiccatum;
}
this.exsiccatum = exsiccatum;
}
- public void setCollection(CollectionDTO collection) {
- this.collection = collection;
- }
-
public String getCatalogNumber() {
return catalogNumber;
}
-
public void setCatalogNumber(String catalogNumber) {
this.catalogNumber = catalogNumber;
}
public String getBarcode() {
return barcode;
}
-
public void setBarcode(String barcode) {
this.barcode = barcode;
}
public String getPreservationMethod() {
return preservationMethod;
}
-
public void setPreservationMethod(String preservationMethod) {
this.preservationMethod = preservationMethod;
}
- /**
- * @return the collection
- *
- * @deprecated TODO remove as it only duplicates the information contained in the collectionDTO
- */
- @Deprecated
- public String getCollectionCode() {
- if (collection != null){
- return collection.getCode();
- } else {
- return null;
- }
- }
-
- /**
- * @return the collection
- */
public CollectionDTO getCollection() {
return collection;
}
-
- /**
- * @param collection the collection to set
- */
public void setCollectioDTO(CollectionDTO collection) {
this.collection = collection;
}
@Override
protected void updateTreeDependantData() {
// TODO DerivationTreeSummaryDTO should be updated here once it is refactored so that it can operate on dtos
-
}
-
-}
+}
\ No newline at end of file