From: Fabrice Bellingard Date: Mon, 16 Jul 2012 09:54:30 +0000 (+0200) Subject: SONAR-2496 Fix HQL request that doesn't work on Oracle... X-Git-Tag: 3.2~63 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8586c9fc456d84ee7b8dfa9d7a5ef78672ab1a12;p=sonarqube.git SONAR-2496 Fix HQL request that doesn't work on Oracle... --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinderByPreviousVersion.java b/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinderByPreviousVersion.java index ea2f23ee7b1..b0b54947df1 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinderByPreviousVersion.java +++ b/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinderByPreviousVersion.java @@ -38,7 +38,7 @@ public class PastSnapshotFinderByPreviousVersion implements BatchExtension { PastSnapshot findByPreviousVersion(Snapshot projectSnapshot) { String hql = "from " + Snapshot.class.getSimpleName() + - " where version!=:version AND version!='' AND resourceId=:resourceId AND status=:status AND qualifier<>:lib order by createdAt desc"; + " where version<>:version AND version IS NOT NULL AND resourceId=:resourceId AND status=:status AND qualifier<>:lib order by createdAt desc"; List snapshots = session.createQuery(hql) .setParameter("version", projectSnapshot.getVersion()) .setParameter("resourceId", projectSnapshot.getResourceId())