omnifaces / omnipersistence

Utilities for JPA, JDBC and DataSources
Other
31 stars 12 forks source link

Not possible to use field names containing capitals #19

Closed Edubits closed 5 years ago

Edubits commented 5 years ago

In several locations Lang.toTitleCase() is used to convert a field name to a getter. This works fine when the field name doesn't contain any capitals, however it has unexpected results when it does contain capitals.

For example:

field = "created";
Lang.toTitleCase(field); // Result: Created

field = "totalPrice";
Lang.toTitleCase(field); // Result: Totalprice

Note the lowercased p. The expected value is TotalPrice which leads to a getter getTotalPrice().