Revision b7317c6c
Added by Andreas Müller almost 6 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/CdmGenericDaoImpl.java | ||
---|---|---|
582 | 582 |
ClassMetadata classMetaData = session.getSessionFactory().getClassMetadata(matchClass.getCanonicalName()); |
583 | 583 |
Criteria criteria = session.createCriteria(matchClass); |
584 | 584 |
boolean noMatch = makeCriteria(objectToMatch, matchStrategy, classMetaData, criteria); |
585 |
logger.debug(criteria);
|
|
585 |
if (logger.isDebugEnabled()){logger.debug(criteria);}
|
|
586 | 586 |
//session.flush(); |
587 | 587 |
if (noMatch == false){ |
588 | 588 |
@SuppressWarnings("unchecked") |
... | ... | |
614 | 614 |
Criteria criteria) throws IllegalAccessException, MatchException { |
615 | 615 |
Matching matching = matchStrategy.getMatching(); |
616 | 616 |
boolean noMatch = false; |
617 |
Map<String, List<MatchMode>> replaceMatchers = new HashMap<String, List<MatchMode>>();
|
|
617 |
Map<String, List<MatchMode>> replaceMatchers = new HashMap<>(); |
|
618 | 618 |
for (CacheMatcher cacheMatcher: matching.getCacheMatchers()){ |
619 | 619 |
boolean cacheProtected = (Boolean)cacheMatcher.getProtectedField(matching).get(objectToMatch); |
620 | 620 |
if (cacheProtected == true){ |
... | ... | |
630 | 630 |
String propertyName = replacementMode.getFirstResult(); |
631 | 631 |
List<MatchMode> replaceMatcherList = replaceMatchers.get(propertyName); |
632 | 632 |
if (replaceMatcherList == null){ |
633 |
replaceMatcherList = new ArrayList<MatchMode>();
|
|
633 |
replaceMatcherList = new ArrayList<>(); |
|
634 | 634 |
replaceMatchers.put(propertyName, replaceMatcherList); |
635 | 635 |
} |
636 | 636 |
replaceMatcherList.add(replacementMode.getSecondResult()); |
... | ... | |
643 | 643 |
String propertyName = fieldMatcher.getPropertyName(); |
644 | 644 |
Type propertyType = classMetaData.getPropertyType(propertyName); |
645 | 645 |
Object value = fieldMatcher.getField().get(objectToMatch); |
646 |
List<MatchMode> matchModes= new ArrayList<MatchMode>();
|
|
646 |
List<MatchMode> matchModes= new ArrayList<>(); |
|
647 | 647 |
matchModes.add(fieldMatcher.getMatchMode()); |
648 | 648 |
if (replaceMatchers.get(propertyName) != null){ |
649 | 649 |
matchModes.addAll(replaceMatchers.get(propertyName)); |
Also available in: Unified diff
cleanup