Package org.jdbi.v3.core.mapper.reflect
Class ReflectionMappers
java.lang.Object
org.jdbi.v3.core.mapper.reflect.ReflectionMappers
- All Implemented Interfaces:
JdbiConfig<ReflectionMappers>
Configuration class for reflective mappers.
-
Constructor Summary
ConstructorDescriptionCreate a default configuration that attempts case insensitive and snake_case matching for names. -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this configuration object.Returns the registered column name mappers.boolean
Returns whether strict column name matching is enabled.setColumnNameMatchers
(List<ColumnNameMatcher> columnNameMatchers) Replace all column name matchers with the given list.setStrictMatching
(boolean strictMatching) Throw an IllegalArgumentException if a the set of fields doesn't match to columns exactly.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jdbi.v3.core.config.JdbiConfig
setRegistry
-
Constructor Details
-
ReflectionMappers
public ReflectionMappers()Create a default configuration that attempts case insensitive and snake_case matching for names.
-
-
Method Details
-
getColumnNameMatchers
Returns the registered column name mappers.- Returns:
- the registered column name mappers.
-
setColumnNameMatchers
Replace all column name matchers with the given list.- Parameters:
columnNameMatchers
- the column name matchers to use- Returns:
- this
-
isStrictMatching
public boolean isStrictMatching()Returns whether strict column name matching is enabled.- Returns:
- True if strict column name matching is enabled.
-
setStrictMatching
Throw an IllegalArgumentException if a the set of fields doesn't match to columns exactly. Reflection mappers with prefixes will only check those columns that begin with the mapper's prefix.- Parameters:
strictMatching
- whether to enable strict matching- Returns:
- this
-
createCopy
Description copied from interface:JdbiConfig
Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
createCopy
in interfaceJdbiConfig<ReflectionMappers>
- Returns:
- a copy of this configuration object.
-