X-Git-Url: http://jaekl.net/gitweb/?p=cfb.git;a=blobdiff_plain;f=prod%2Fnet%2Fjaekl%2Fcfb%2Fstore%2FDbStore.java;h=3860ca5637e5c2fd31f93bec95b1d59900dec6d5;hp=6c2097925f3d78a3c14fb91e6325643d66578be1;hb=2769cf82ccae57ee3716aecc9bd694be1f115d92;hpb=ad28a221a70f4cea8753bd3070255a8c6a151739 diff --git a/prod/net/jaekl/cfb/store/DbStore.java b/prod/net/jaekl/cfb/store/DbStore.java index 6c20979..3860ca5 100644 --- a/prod/net/jaekl/cfb/store/DbStore.java +++ b/prod/net/jaekl/cfb/store/DbStore.java @@ -54,6 +54,7 @@ public class DbStore { Object[][] values = { { Long.valueOf(runId), + analysis.getProjectName(), analysis.getBuildNumber(), analysis.getStart(), analysis.getEnd() @@ -287,7 +288,10 @@ public class DbStore { { Column[] columns = { CfbSchema.RUNID }; Table[] tables = { CfbSchema.RUNS }; - Condition[] conditions = { new Condition( CfbSchema.STARTTIME, analysis.getStart(), Operation.LESS_THAN ) }; + Condition[] conditions = { + new Condition( CfbSchema.PROJNAME, analysis.getProjectName(), Operation.EQUAL ), + new Condition( CfbSchema.STARTTIME, analysis.getStart(), Operation.LESS_THAN ) + }; Sort[] sorts = { new Sort( CfbSchema.STARTTIME, Sort.Direction.DESCENDING ) }; int limit = 1; @@ -300,7 +304,7 @@ public class DbStore { Analysis getAnalysis(Long analysisId) throws SQLException, TypeMismatchException { - Column[] columns = { CfbSchema.VERSION, CfbSchema.STARTTIME, CfbSchema.ENDTIME }; + Column[] columns = { CfbSchema.PROJNAME, CfbSchema.VERSION, CfbSchema.STARTTIME, CfbSchema.ENDTIME }; Table[] tables = { CfbSchema.RUNS }; Condition[] conditions = { new Condition( CfbSchema.RUNID, analysisId, Operation.EQUAL ) }; @@ -311,11 +315,12 @@ public class DbStore { Row row = rows.get(0); - String version = row.getString(0); - java.util.Date start= row.getDate(1); - java.util.Date end = row.getDate(2); + String projName = row.getString(0); + String version = row.getString(1); + java.util.Date start= row.getDate(2); + java.util.Date end = row.getDate(3); - Analysis prior = new Analysis(version); + Analysis prior = new Analysis(projName, version); prior.setId(analysisId.longValue()); prior.setStart(start); prior.setEnd(end);