aaberg / sql2o

sql2o is a small library, which makes it easy to convert the result of your sql-statements into objects. No resultset hacking required. Kind of like an orm, but without the sql-generation capabilities. Supports named parameters.
http://sql2o.org
MIT License
1.15k stars 229 forks source link

Column mappings failed #335

Open LinggaAskaEdo opened 5 years ago

LinggaAskaEdo commented 5 years ago

Based on this docs: https://github.com/aaberg/sql2o/wiki/Column-mappings

  1. Failed mapping when SELECT

Old query: SELECT created_date createdDate, user_id userId, phone FROM mob_user WHERE userId = :userIdParam Exception: Database error: ORA-00904: "USERID": invalid identifier

But its success when query like this: New query: SELECT created_date createdDate, user_id userId, phone FROM mob_user WHERE user_id = :userIdParam

  1. Failed mapping when UPDATE

Old query: UPDATE mob_user SET cuid = :cuidParam WHERE user_id = :userIdParam Exception: - (but field not updated)

But its success when query like this: New query: UPDATE mob_user SET cuid = :cuidParam WHERE phone = :phoneParam

Can you help me what's wrong??? I see something is wrong with the column using underscore. I'm using sql2o version 1.6.

MAVEN

org.sql2o sql2o 1.6.0
strogiyotec commented 4 years ago

@LinggaAskaEdo could you extend your context , how your table looks like, how do you execute queries above, what database do you use