From aa84447a19ab21e5929e088ada4334fe784eae30 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 20 Jul 2012 18:11:58 +0200 Subject: [PATCH] LayoutItemFIeld: getName(): Use the Field if it is set. * src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java: getName(): If the full field details have been set, return its name, so that callers do not need to set the name separately. * src/test/java/org/glom/web/server/SelfHostExampleTest.java: testExampleMusiccollectionData): Do not use a TYPE_FORWARD_ONLY statement, so we can count the rows. --- ChangeLog | 11 +++++++++++ .../org/glom/web/shared/libglom/layout/LayoutItemField.java | 9 +++++++++ src/test/java/org/glom/web/server/SelfHostExampleTest.java | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4375618..3d2efeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2012-07-20 Murray Cumming + LayoutItemFIeld: getName(): Use the Field if it is set. + + * src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java: + getName(): If the full field details have been set, return its name, so that + callers do not need to set the name separately. + * src/test/java/org/glom/web/server/SelfHostExampleTest.java: + testExampleMusiccollectionData): Do not use a TYPE_FORWARD_ONLY statement, + so we can count the rows. + +2012-07-20 Murray Cumming + tests: SelfHoster: Test SqlUtils too. * src/test/java/org/glom/web/server/SelfHostExampleTest.java: diff --git a/src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java b/src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java index 99d023d..99076ef 100644 --- a/src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java +++ b/src/main/java/org/glom/web/shared/libglom/layout/LayoutItemField.java @@ -27,6 +27,15 @@ public class LayoutItemField extends LayoutItemWithFormatting implements UsesRel // Extras: private String navigationTableName = null; // If any. + @Override + public String getName() { + if(field == null) { + return super.getName(); + } else { + return field.getName(); + } + } + /** * @return the field */ diff --git a/src/test/java/org/glom/web/server/SelfHostExampleTest.java b/src/test/java/org/glom/web/server/SelfHostExampleTest.java index 6ec4800..b7f8cc3 100644 --- a/src/test/java/org/glom/web/server/SelfHostExampleTest.java +++ b/src/test/java/org/glom/web/server/SelfHostExampleTest.java @@ -89,7 +89,7 @@ public class SelfHostExampleTest { final Connection conn = selfHoster.createConnection(false); assertTrue(conn != null); - final Statement st = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); + final Statement st = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); //st.setFetchSize(length); final ResultSet rs = st.executeQuery(sqlQuery); assertTrue(rs != null); -- 2.1.4