Package org.jdbi.v3.core.mapper.reflect
Class SnakeCaseColumnNameMatcher
java.lang.Object
org.jdbi.v3.core.mapper.reflect.SnakeCaseColumnNameMatcher
- All Implemented Interfaces:
ColumnNameMatcher
Matches snake case column names to java camel case names, ignoring case.
Example: column names first_name or FIRST_NAME would match java name firstName.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancolumnNameMatches(String columnName, String javaName) Returns whether the column name fits the given Java identifier name.booleancolumnNameStartsWith(String columnName, String prefix) Return whether the column name starts with the given prefix, according to the matching strategy of thisColumnNameMatcher.toString()
-
Constructor Details
-
SnakeCaseColumnNameMatcher
public SnakeCaseColumnNameMatcher()
-
-
Method Details
-
columnNameMatches
Description copied from interface:ColumnNameMatcherReturns whether the column name fits the given Java identifier name.- Specified by:
columnNameMatchesin interfaceColumnNameMatcher- Parameters:
columnName- the SQL column namejavaName- the Java property, field, or parameter name- Returns:
- whether the given names are logically equivalent
-
columnNameStartsWith
Description copied from interface:ColumnNameMatcherReturn whether the column name starts with the given prefix, according to the matching strategy of thisColumnNameMatcher. This method is used by reflective mappers to short-circuit nested mapping when no column names begin with the nested prefix. By default, this method returnscolumnName.startWith(prefix). Third party implementations should override this method to match prefixes by the same criteria asColumnNameMatcher.columnNameMatches(String, String).- Specified by:
columnNameStartsWithin interfaceColumnNameMatcher- Parameters:
columnName- the column name to testprefix- the prefix to test for- Returns:
- whether the column name begins with the prefix.
-
toString
-