Skip to content

Commit 36c1131

Browse files
committed
rationale for throwing on mismatch property
1 parent 3506748 commit 36c1131

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mug-guava/src/main/java/com/google/mu/safesql/SafeSql.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,11 @@ public SafeSql orElse(Supplier<SafeSql> fallback) {
791791
* is null, the property will be left as is.
792792
* <li>If you can't make a bean property match a query column, you can annotate the setter method
793793
* with the {@code @SqlName} annotation to customize the column name.
794+
* <li>Exception will be thrown if a column doesn't map to a settable property, yet
795+
* there are property not being populated, because this often is a result of
796+
* programming error. For example, you may have renamed a property but forgot to rename the
797+
* corresponding query column. In such case, failing loudly and clearly is safer than letting
798+
* the program silently run with corrupted state.
794799
* </ul>
795800
*
796801
* @throws UncheckedSqlException wraps {@link SQLException} if failed

0 commit comments

Comments
 (0)