hi friends, Can we use column alias in a hibernate native sql query, i found we cannt , if we do we have to use addScalar function and give the type of column we want to return, the problem with this is we have to change the code if we alter the structure of the table,
Also i found we cannt use a query like:
SELECT IF(true,'',textcolumn) from sometable
where textcolumn is a column of type text .(i am using mysql).
pl advice how can we do a if and either return a varchar and a text value.
pl advise , thanks abhishek
|