Hi
On 21/06/13 15:24, nikosdim wrote:
Hi
I tried this
jpa.selectConstruct(selections);
CriteriaQuery<Tuple> cquery = jpa.getQuery();
return em.createQuery(cquery).getResultList();
and it works. It gives me what I want but it is not dynamic. I have a few
attributes in my Book class and the selection of what is going to be
returned in the selections is defined by the user of the Web Service. As a
result the solution to this is to make constructors to cover every possible
combination of the attributes which doesn't seem to be correct.
If you use Tuple then it is dynamic, use that (see the wiki, or Tuple
example code I sent)
I'll have a look with the JPA2 CriteriaQuery and I will let you know
Sure, please investigate more. I guess that Tuple is exactly what you
need. The only difference is that you'd need to convert from Tuple to
Book yourself, but it can faster than JPA2 constructing Book for you
Sergey
Thanks
--
View this message in context:
http://cxf.547215.n5.nabble.com/How-to-select-specific-columns-to-retrieve-with-FIQL-using-JPATypedQueryVisitor-tp5729548p5729665.html
Sent from the cxf-user mailing list archive at Nabble.com.
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com