SQL column names must be escaped
Miha-x64 opened this issue · 4 comments
Miha-x64 commented
AbstractDao#findById
executes such SQL for me:
select id, urlPathComponent, metaTitle, metaDescription, metaKeywords, linkText, h1, description, sortIndex, lastModified
from whatever
where id = :id
which is incorrect for PostgreSQL dialect: it requires camelCase column names to be in quotes, at least like this:
select id, "urlPathComponent", "metaTitle", "metaDescription", "metaKeywords", "linkText", h1, description, "sortIndex", "lastModified"
from whatever
where id = :id
andrewoma commented
Maybe try using a custom naming convention that applies quotes:
Miha-x64 commented
Column names remain unchanged in SQL: they neither getting underscored (by default namingConvention), nor quoted (after adding TableConfiguration).
andrewoma commented
Sounds a bit surprising. I'll have a look tomorrow my time
Miha-x64 commented
Maybe that's because I specify col names explicitly. And it looks quite uncomfortable and dangerous to write "\"columnName\""
in every table.