Case
SQLQueryEncoder.KeyEncodingStrategy.convertToSnakeCase
Convert from
camelCaseKeys to snake_case_keys before writing a key to a row.case convertToSnakeCase
Discussion
Capital characters are determined by testing Character.isUppercase.
Converting from camel case to snake case:
Splits words at the boundary of lower-case to upper-case.
Inserts
_between words.Lowercases the entire string.
Preserves starting and ending
_.
For example, oneTwoThree becomes one_two_three. _oneTwoThree_ becomes _one_two_three_.
Note
Using a key encoding strategy has a nominal performance cost, as each string key has to be converted.