aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java')
-rwxr-xr-xsrc/main/java/io/trygvis/esper/testing/core/db/BuildDao.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java b/src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java
index c6a46c6..7c9ccb7 100755
--- a/src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java
+++ b/src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java
@@ -92,7 +92,7 @@ public class BuildDao {
public List<BuildDto> selectBuildsByPerson(Uuid person, PageRequest page) throws SQLException {
String sql = "SELECT " + BUILD + " FROM build b, build_participant bp WHERE bp.person=? AND b.uuid = bp.build";
- sql += orderBy(page.orderBy, "created_date", "timestamp");
+ sql += orderBy(ifEmpty(page.orderBy, "created_date-"), "created_date", "timestamp");
sql += " LIMIT ? OFFSET ?";
try (PreparedStatement s = c.prepareStatement(sql)) {
@@ -106,7 +106,7 @@ public class BuildDao {
public List<BuildDto> selectBuilds(PageRequest page) throws SQLException {
String sql = "SELECT " + BUILD + " FROM build";
- sql += orderBy(page.orderBy, "created_date", "timestamp");
+ sql += orderBy(ifEmpty(page.orderBy, "created_date-"), "created_date", "timestamp");
sql += " LIMIT ? OFFSET ?";
try (PreparedStatement s = c.prepareStatement(sql)) {