jpql constructor expressions : using java methods insode constructor
ChiragJan 17 2011 — edited Jan 19 2011I have 2 questions:
First:
this works:
select NEW com.FirstClass(a.name) from Employee a;
I want to pass a.name to some java method, something like this:
select NEW com.FirstClass(com.SecondClass.factorString(a.name)) from Employee a;
basically, I want to call a java function inside constructor. but it does not work.
Second:
if the forst approach is not permitted, we would like to call Oracle SPs from jpql select query, but it seems that it is not permitted. like this:
select a.name, DBP_EMP.CALC_COMMISION(a.emp_id) from Employee a;
It is also not working.
Please give some suggestions..