]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2496 Fix HQL request that doesn't work on Oracle...
authorFabrice Bellingard <bellingard@gmail.com>
Mon, 16 Jul 2012 09:54:30 +0000 (11:54 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Mon, 16 Jul 2012 09:55:15 +0000 (11:55 +0200)
sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinderByPreviousVersion.java

index ea2f23ee7b1bbf5ac9771718169035dfe16337ab..b0b54947df13c60c3742ea19d4a59cccc74814e2 100644 (file)
@@ -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<Snapshot> snapshots = session.createQuery(hql)
         .setParameter("version", projectSnapshot.getVersion())
         .setParameter("resourceId", projectSnapshot.getResourceId())