Skip to content
Snippets Groups Projects
Commit 6342442a authored by Nikolaus Krismer's avatar Nikolaus Krismer
Browse files

minor code formatting

parent b9a5013a
No related branches found
No related tags found
No related merge requests found
...@@ -85,8 +85,7 @@ public final class DbUtility { ...@@ -85,8 +85,7 @@ public final class DbUtility {
} }
public static void createSpatialIndex(final Connection connection, final TableEntry tableEntry) { public static void createSpatialIndex(final Connection connection, final TableEntry tableEntry) {
executeStatement(connection, "CREATE INDEX " + tableEntry.getIndexName() + " ON " + tableEntry.getTableName() executeStatement(connection, "CREATE INDEX " + tableEntry.getIndexName() + " ON " + tableEntry.getTableName() + " USING GIST(\"GEOMETRY\")");
+ " USING GIST(\"GEOMETRY\")");
} }
public static boolean dropTablesByRegexp(final Connection connection, final String regex) { public static boolean dropTablesByRegexp(final Connection connection, final String regex) {
...@@ -130,24 +129,20 @@ public final class DbUtility { ...@@ -130,24 +129,20 @@ public final class DbUtility {
} }
public static void createVertexAnnotationTable(final Connection connection, final String tableName) { public static void createVertexAnnotationTable(final Connection connection, final String tableName) {
executeStatement(connection, "CREATE TABLE " + tableName executeStatement(connection, "CREATE TABLE " + tableName + " (\"ID\" integer NOT NULL, \"ROUTE_ID\" smallint,\"TIME_A\" integer,\"TIME_D\" integer)");
+ " (\"ID\" integer NOT NULL, \"ROUTE_ID\" smallint,\"TIME_A\" integer,\"TIME_D\" integer)");
} }
public static void createTargetVertexTable(final Connection connection, final String tableName) { public static void createTargetVertexTable(final Connection connection, final String tableName) {
executeStatement(connection, "CREATE TABLE " + tableName executeStatement(connection, "CREATE TABLE " + tableName + " (\"ID\" integer NOT NULL, \"DISTANCE\" double precision, \"ROUTE_ID\" smallint, \"STATE\" VARCHAR(7), \"T_TYPE\" smallint)");
+ " (\"ID\" integer NOT NULL, \"DISTANCE\" double precision, \"ROUTE_ID\" smallint, \"STATE\" VARCHAR(7), \"T_TYPE\" smallint)");
} }
public static void createTargetBufferTable(final Connection connection, final String tableName) { public static void createTargetBufferTable(final Connection connection, final String tableName) {
executeStatement(connection, "CREATE TABLE " + tableName executeStatement(connection, "CREATE TABLE " + tableName + " (\"ID\" integer NOT NULL, CONSTRAINT pkey_" + tableName + " PRIMARY KEY (\"ID\"))");
+ " (\"ID\" integer NOT NULL, CONSTRAINT pkey_" + tableName
+ " PRIMARY KEY (\"ID\"))");
} }
public static ResponsePoiFeature getPoiFeatures(final String sqlExpr, final ConfigDataset config) { public static ResponsePoiFeature getPoiFeatures(final String sqlExpr, final ConfigDataset config) {
final ResponsePoiFeature result = new ResponsePoiFeature(); final ResponsePoiFeature result = new ResponsePoiFeature();
if (sqlExpr.equals("noResult")) { if ("noResult".equals(sqlExpr)) {
result.setType("invalid"); result.setType("invalid");
return result; return result;
} }
...@@ -180,7 +175,6 @@ public final class DbUtility { ...@@ -180,7 +175,6 @@ public final class DbUtility {
} }
public static ResponseWps spatialIntersection2JSON(final String sqlExpr, final SqlQuery query, final ConfigDataset config) { public static ResponseWps spatialIntersection2JSON(final String sqlExpr, final SqlQuery query, final ConfigDataset config) {
final boolean isSum = query.getQueryType().equals(QueryType.SUM);
final ResponseWps result = new ResponseWps(query.getQueryType().toString().toLowerCase()); final ResponseWps result = new ResponseWps(query.getQueryType().toString().toLowerCase());
if (sqlExpr.equals("noResult")) { if (sqlExpr.equals("noResult")) {
result.setType("invalid"); result.setType("invalid");
...@@ -205,6 +199,7 @@ public final class DbUtility { ...@@ -205,6 +199,7 @@ public final class DbUtility {
} }
} }
final boolean isSum = query.getQueryType().equals(QueryType.SUM);
double sum = isSum ? 0 : -1; double sum = isSum ? 0 : -1;
while (rSet.next()) { while (rSet.next()) {
final WpsFeature feature = new WpsFeature(); final WpsFeature feature = new WpsFeature();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment