Hi vrkraju,
1/ - when using the createQuery function, you must provide a HQL as argument and NOT native SQL. So your query is class and object oriented.
2/ - in you query :
Code:
select upper(substring(ltrim(usr_First_Name),1,1)) from usr
it seams that you have a class called usr (lowercase.... Strange for a java class) and a property called usr_First_Name. If this is the case try this:
Code:
select upper(substring(ltrim(u.usr_First_Name),1,1)) from usr u
If not, replace the corresponding mappings for usr (use the class name) and for usr_First_Name (use the property name).
Hope this helps