Fixed message count per label

This commit is contained in:
Christian Basler 2016-08-25 08:50:06 +02:00
parent caa2219a63
commit 102d63e2c6
3 changed files with 3 additions and 4 deletions

View File

@ -30,7 +30,7 @@ dependencies {
compile project(':wif') compile project(':wif')
compile 'org.slf4j:slf4j-simple:1.7.12' compile 'org.slf4j:slf4j-simple:1.7.12'
compile 'args4j:args4j:2.32' compile 'args4j:args4j:2.32'
compile 'com.h2database:h2:1.4.190' compile 'com.h2database:h2:1.4.192'
compile 'org.apache.commons:commons-lang3:3.4' compile 'org.apache.commons:commons-lang3:3.4'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19' testCompile 'org.mockito:mockito-core:1.10.19'

View File

@ -16,7 +16,7 @@ dependencies {
compile project(':core') compile project(':core')
compile 'org.flywaydb:flyway-core:4.0.3' compile 'org.flywaydb:flyway-core:4.0.3'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
testCompile 'com.h2database:h2:1.4.190' testCompile 'com.h2database:h2:1.4.192'
testCompile 'org.mockito:mockito-core:1.10.19' testCompile 'org.mockito:mockito-core:1.10.19'
testCompile project(path: ':core', configuration: 'testArtifacts') testCompile project(path: ':core', configuration: 'testArtifacts')
testCompile project(':cryptography-bc') testCompile project(':cryptography-bc')

View File

@ -81,8 +81,7 @@ public class JdbcMessageRepository extends AbstractMessageRepository implements
try ( try (
Connection connection = config.getConnection(); Connection connection = config.getConnection();
Statement stmt = connection.createStatement(); Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT count(*) FROM Message WHERE " + where ResultSet rs = stmt.executeQuery("SELECT count(*) FROM Message WHERE " + where)
+ " ORDER BY received DESC")
) { ) {
if (rs.next()) { if (rs.next()) {
return rs.getInt(1); return rs.getInt(1);