简体   繁体   中英

Oracle Custom sql in Liferay

I am using oracle DB and writing the custom SQL in life-ray. If I am missing any one column name in SQL query then its throwing below error, Please help to avoid this error because I want to escape some columns names.

General Example (not from code)...,
    1) select a,b,c from alphabets; (its working fine).
    2) select b,c from alphabets;(its throwing below error).

I rarely do raw hibernate these days, but I expect queryObject.addEntity("COMROLETAB", COMROLETABImpl.class); to require data for all fields of COMROLETABImpl, which you don't provide in sql2.

There's another option if sql1 is actually coming in from out of the scope that you post here, because you're defining sqls while you're referring to sql1 .

Note that the code snippet that you're posting here is also leaking session objects - sooner or later you'll run out of database connections. You'll need to read on error handling and resource handling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM