Project

General

Profile

Revision 2656a2c6

ID2656a2c66fa333ad0186cff2b481d278c5561c13
Parent b5aa6bf0
Child 7264ff5f

Added by Katja Luther 2 months ago

adapt query to original source

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/name/RegistrationDaoHibernateImpl.java
125 125
        if (reference == null){
126 126
            //do nothing
127 127
        }else if (reference.isPresent()){
128
           from += "   LEFT JOIN n.nomenclaturalReference nomRef "
129
                   + " LEFT JOIN desig.citation desigRef ";
128
           from += "   LEFT JOIN n.nomenclaturalSource nomSource "
129
                   + " LEFT JOIN desig.source desigSource ";
130 130
           where += " AND ("
131
                   + "     nomRef =:ref "
132
                   + "     OR (nomRef.type =:refType AND nomRef.inReference =:ref) "
133
                   + "     OR desigRef =:ref "
134
                   + "     OR (desigRef.type =:refType AND desigRef.inReference =:ref)"
131
                   + "     nomSource.citation =:ref "
132
                   + "     OR (nomSource.citation.type =:refType AND nomSource.citation.inReference =:ref) "
133
                   + "     OR desigSource.citation =:ref "
134
                   + "     OR (desigSource.citation.type =:refType AND desigSource.citation.inReference =:ref)"
135 135
                   + ")";
136 136
           refTypeParameter = ReferenceType.Section;
137 137
        }else{  //ref is null
138 138
           where += " AND ((r.name IS NULL AND size(r.typeDesignations) = 0 ) "
139
                   + "     OR (n IS NOT NULL AND r.name.nomenclaturalReference IS NULL ) "
140
                   + "     OR (size(r.typeDesignations) > 0 AND desig.citation IS NULL )"
139
                   + "     OR (n IS NOT NULL AND (r.name.nomenclaturalSource IS NULL OR r.name.nomenclaturalSource.citation IS NULL)) "
140
                   + "     OR (size(r.typeDesignations) > 0 AND (desig.source IS NULL OR desig.source.citation IS NULL))"
141 141
                   + ") "
142 142
                   ;
143 143
        }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)