From 77f8503e98faa8d76c33756670e3d23bf189ef58 Mon Sep 17 00:00:00 2001 From: Byunghwa Yun Date: Thu, 22 Sep 2016 19:00:16 +0900 Subject: [PATCH] NIFI-2802 The implementation classes don't support orderByClause. This closes #1044. --- .../processors/standard/db/impl/GenericDatabaseAdapter.java | 2 +- .../nifi/processors/standard/db/impl/OracleDatabaseAdapter.java | 2 +- .../nifi/processors/standard/db/impl/DerbyDatabaseAdapter.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/GenericDatabaseAdapter.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/GenericDatabaseAdapter.java index 5beae2985b..c48d2cdb58 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/GenericDatabaseAdapter.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/GenericDatabaseAdapter.java @@ -48,7 +48,7 @@ public class GenericDatabaseAdapter implements DatabaseAdapter { } if (!StringUtils.isEmpty(orderByClause)) { query.append(" ORDER BY "); - query.append(whereClause); + query.append(orderByClause); } if (limit != null) { query.append(" LIMIT "); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/OracleDatabaseAdapter.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/OracleDatabaseAdapter.java index ffe54dc345..d918400dc7 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/OracleDatabaseAdapter.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/db/impl/OracleDatabaseAdapter.java @@ -62,7 +62,7 @@ public class OracleDatabaseAdapter implements DatabaseAdapter { } if (!StringUtils.isEmpty(orderByClause)) { query.append(" ORDER BY "); - query.append(whereClause); + query.append(orderByClause); } if (nestedSelect) { query.append(") a"); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/db/impl/DerbyDatabaseAdapter.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/db/impl/DerbyDatabaseAdapter.java index 135695938a..7d6ab8970f 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/db/impl/DerbyDatabaseAdapter.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/db/impl/DerbyDatabaseAdapter.java @@ -49,7 +49,7 @@ public class DerbyDatabaseAdapter implements DatabaseAdapter { } if (!StringUtils.isEmpty(orderByClause)) { query.append(" ORDER BY "); - query.append(whereClause); + query.append(orderByClause); } if (offset != null && offset > 0) { query.append(" OFFSET ");