brettwooldridge / SansOrm

A "No-ORM" sane SQL ←→ Java object mapping library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with upper case column names

kodarust opened this issue · comments

We use a sybase database with uppercase table and column names.

In Introspected#processColumnAnnotation the FieldColumnInfo.columnName is lower cased from the @column annotation. This leads to errors with the SQL statements generated by SqlClosureElf. (changing the behavior of sybase requires a global modification of sorting on the sybase server and is not an option.)

Is the toLowerCase() required for column names or can this be changed - in gereral or with a configurable default behavior?

Besides getting the column name from field name is not consistent.
If the field has a @column annotation without name attribute, the field name is accepted as is. (line 475)
If the field has no annotation the field name will be lower cased. (line 501)

@brettwooldridge What about escaping to preserve exact form? See Vlad Mihalcea's comment here
https://twitter.com/lukaseder/status/573506390960050178

It seems like we could offer a system property or equivalent that configures that behavior. Pull requests welcome. 😉

Why not same behaviour as Hibernate with column name in quotes?

Thank you all for this solution.