jrsteinebrey commented on code in PR #8892:
URL: https://github.com/apache/nifi/pull/8892#discussion_r1723405142
##########
nifi-extension-bundles/nifi-standard-bundle/nifi-standard-parameter-providers/src/main/java/org/apache/nifi/parameter/DatabaseParameterProvider.java:
##########
@@ -38,37 +26,31 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.ServiceLoader;
import java.util.stream.Collectors;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.components.AllowableValue;
+import org.apache.nifi.components.ConfigVerificationResult;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.components.PropertyDescriptor.Builder;
+import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.db.DatabaseAdapter;
+import org.apache.nifi.dbcp.DBCPService;
+import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.util.StringUtils;
@Tags({"database", "dbcp", "sql"})
@CapabilityDescription("Fetches parameters from database tables")
public class DatabaseParameterProvider extends AbstractParameterProvider
implements VerifiableParameterProvider {
- protected final static Map<String, DatabaseAdapter> dbAdapters = new
HashMap<>();
-
- public static final PropertyDescriptor DB_TYPE;
-
- static {
- // Load the DatabaseAdapters
- ArrayList<AllowableValue> dbAdapterValues = new ArrayList<>();
- ServiceLoader<DatabaseAdapter> dbAdapterLoader =
ServiceLoader.load(DatabaseAdapter.class);
- dbAdapterLoader.forEach(it -> {
- dbAdapters.put(it.getName(), it);
- dbAdapterValues.add(new AllowableValue(it.getName(), it.getName(),
it.getDescription()));
- });
-
- DB_TYPE = new PropertyDescriptor.Builder()
- .name("db-type")
- .displayName("Database Type")
- .description("The type/flavor of database, used for generating
database-specific code. In many cases the Generic type "
- + "should suffice, but some databases (such as Oracle)
require custom SQL clauses. ")
- .allowableValues(dbAdapterValues.toArray(new
AllowableValue[dbAdapterValues.size()]))
- .defaultValue("Generic")
- .required(true)
- .build();
- }
+ public static final PropertyDescriptor DATABASE_ADAPTER = new Builder()
+ .name("Database Adapter")
+ .description("The service, that is used for generating
database-specific code.")
Review Comment:
@takraj Thanks for working on this change. Please change the description of
all 4 of the DATABASE_ADAPTER properties to the following for better clarity:
Controller Service used for generating database-specific SQL statements. If
you do not see a specific Database Adapter listed for your database provider,
then use the Generic Database Adapter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]