Hi ram,
As far as i know, is not possible to set the select columns as parameters.
If you want to make it dynamic, you can try the Criteria API.
Cheers,Roberto
From: ram <[email protected]>
To: "[email protected]" <[email protected]>
Sent: Monday, February 15, 2016 1:12 PM
Subject: passing select column list as string
Hello,
i was trying to write a namedquery , but would like to pass the select
columns as arguments .
@NamedQuery(name="emp.findAll", query="SELECT s.id.name,s.id.phone,s.address
FROM emp where s.id.name=:na and s.id.phone=:ph").
I would like to pass "s.id.name,s.id.phone,s.address " it as string instead of
entity.column.
@NamedQuery(name="emp.findAll", query="SELECT ?string FROM emp where
s.id.name=:na and s.id.phone=:ph").
can i do this if so how can i pass this ?string
--Thanks