aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-12-29 21:43:28 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2013-01-04 22:09:16 +0100
commit23ce147dd2be1d1956a3ce6e0d2be13c6bd665cf (patch)
tree9a5cc586584b88e88bb3d64c028a414c65ee1d5f /src
parent5ec81d9e77fcb56ddf5953989e23b6cafe4772a3 (diff)
downloadesper-testing-23ce147dd2be1d1956a3ce6e0d2be13c6bd665cf.tar.gz
esper-testing-23ce147dd2be1d1956a3ce6e0d2be13c6bd665cf.tar.bz2
esper-testing-23ce147dd2be1d1956a3ce6e0d2be13c6bd665cf.tar.xz
esper-testing-23ce147dd2be1d1956a3ce6e0d2be13c6bd665cf.zip
o Ordering by created_date desc by default.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main/java/io/trygvis/esper/testing/core/db/BuildDao.java4
-rwxr-xr-xsrc/main/java/io/trygvis/esper/testing/core/db/PersonDao.java2
2 files changed, 3 insertions, 3 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 9fdf3f4..e8623f2 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
@@ -91,7 +91,7 @@ public class BuildDao {
}
public List<BuildDto> selectBuildsByPerson(UUID person, PageRequest page) throws SQLException {
- try (PreparedStatement s = c.prepareStatement("SELECT " + BUILD + " FROM build b, build_participant bp WHERE bp.person=? AND b.uuid = bp.build ORDER BY created_date LIMIT ? OFFSET ?")) {
+ try (PreparedStatement s = c.prepareStatement("SELECT " + BUILD + " FROM build b, build_participant bp WHERE bp.person=? AND b.uuid = bp.build ORDER BY created_date DESC LIMIT ? OFFSET ?")) {
int i = 1;
s.setString(i++, person.toString());
s.setInt(i++, page.count.orSome(10));
@@ -101,7 +101,7 @@ public class BuildDao {
}
public List<BuildDto> selectBuilds(PageRequest page) throws SQLException {
- try (PreparedStatement s = c.prepareStatement("SELECT " + BUILD + " FROM build ORDER BY created_date LIMIT ? OFFSET ?")) {
+ try (PreparedStatement s = c.prepareStatement("SELECT " + BUILD + " FROM build ORDER BY created_date DESC LIMIT ? OFFSET ?")) {
int i = 1;
s.setInt(i++, page.count.orSome(10));
s.setInt(i, page.startIndex.orSome(0));
diff --git a/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java b/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java
index 3288b56..ec1620b 100755
--- a/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java
+++ b/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java
@@ -95,7 +95,7 @@ public class PersonDao {
}
public List<PersonDto> selectPersons(PageRequest pageRequest) throws SQLException {
- try (PreparedStatement s = c.prepareStatement("SELECT " + PERSON + " FROM person ORDER BY created_date, name LIMIT ? OFFSET ?")) {
+ try (PreparedStatement s = c.prepareStatement("SELECT " + PERSON + " FROM person ORDER BY created_date DESC, name LIMIT ? OFFSET ?")) {
int i = 1;
s.setInt(i++, pageRequest.count.orSome(10));
s.setInt(i, pageRequest.startIndex.orSome(0));