ORA-01747: invalid user.table.column, table.column, or column specification
Today I got this error.
ORA-01747: invalid user.table.column, table.column, or column specification.
There could be many reasons why you can get this error. But the basic reason is the query which is finally getting executed to your database is wrong in some way. In my case, I had a column with column name as DESC. I got rid of this problem by simply dropping the table and creating a new one with column name DESCRIPTION instead of DESC. You may not be able to do that if the table is already existing with many records in it.
Other reason could be that, if you are using named query your named query is not syntactically right.
No matter how the you get this error or for that matter any DB error in Hibernate, the best approach is to enable the show_sql variable in hibernate configuration and get the final query which hibernate is firing against the database.
Get this query and try running it directly in your database client. You can easily find out the culprit part of the query from there. Once you find out root cause of the problem you can think of workarounds or solution for this problem.
And yes, don’t forget to turn off the show_sql parameter after you are done with it. It will unnecessarily clutter your logs.