From dd8806b5424627622be3af9a7d74a8497dbd42ff Mon Sep 17 00:00:00 2001 From: jam01 Date: Sat, 22 Aug 2026 00:33:26 -0500 Subject: [PATCH] chore: add javadoc to SqlOutputType enum constants Document what each output type (SelectOne, SelectList, StreamList) produces for the SQL producer and consumer, based on the existing behavior in DefaultSqlEndpoint/SqlProducer/SqlConsumer. Backport of the main branch change. Co-Authored-By: Claude Sonnet 5 --- .../camel/component/sql/SqlOutputType.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlOutputType.java b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlOutputType.java index a9a7303c1bbca..c2f461501d6b1 100644 --- a/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlOutputType.java +++ b/components/camel-sql/src/main/java/org/apache/camel/component/sql/SqlOutputType.java @@ -16,9 +16,35 @@ */ package org.apache.camel.component.sql; +/** + * The type of output produced by the SQL producer and consumer for the result of a query. + */ public enum SqlOutputType { + /** + * Returns the result of the query as a single object. + *

+ * If the query has only a single column, the value of that column is returned (for example + * {@code SELECT COUNT(*) FROM PROJECT} returns a {@link Long}). If the query has more than one + * column, a {@link java.util.Map} of the row is returned. If {@code outputClass} is set, the row + * is instead converted into a Java bean of that type by calling the setters that match the column + * names; the class must have a default constructor. + *

+ * If the query returns more than one row, a non-unique result exception is thrown. + */ SelectOne, + + /** + * Returns the result of the query as a {@link java.util.List} of {@link java.util.Map}, one map per + * row keyed by column name. If {@code outputClass} is set, each row is instead converted into a Java + * bean of that type by calling the setters that match the column names. + */ SelectList, + + /** + * Streams the result of the query using an {@link java.util.Iterator}, so rows are read from the + * {@link java.sql.ResultSet} lazily instead of being loaded into memory all at once. This can be + * combined with the Splitter EIP in streaming mode to process the result set in a streaming fashion. + */ StreamList }