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-x[-rw-r--r--]src/main/java/io/trygvis/esper/testing/core/db/BuildDao.java9
1 files changed, 9 insertions, 0 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 416faf6..c7923d0 100644..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
@@ -81,6 +81,15 @@ public class BuildDao {
}
}
+ public SqlOption<UUID> findBuildByReference(EntityRef ref) throws SQLException {
+ try (PreparedStatement s = c.prepareStatement("SELECT uuid FROM build WHERE reference_type=? AND reference_uuid=?")) {
+ int i = 1;
+ s.setString(i++, ref.type);
+ s.setString(i, ref.uuid.toString());
+ return fromRs(s.executeQuery()).map(getUuid);
+ }
+ }
+
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 ?")) {
int i = 1;