Hi again
I have implemented exactly what you told me but the selections are not
working. I still get back all the columns.
Here is my code
import org.apache.cxf.jaxrs.ext.search.SearchContext;
@Context
SearchContext searchContext;
EntityManagerFactory emf = Persistence
.createEntityManagerFactory("default");
EntityManager em = emf.createEntityManager();
SearchCondition<Book> sc = new FiqlParser<Book>
Book.class).parse(searchContext.getSearchExpression());
JPACriteriaQueryVisitor<Book, Book> visitor =
new JPACriteriaQueryVisitor<Book, Book>(em,
Book.class, Book.class,
beanPropertiesMap);
sc.accept(visitor);
List<SingularAttribute<Book, ?>> selections = new
ArrayList<SingularAttribute<Book, ?>>();
selections.add(Book_.firstname); //where firstname is just a string
TypedQuery query = visitor.getOrderedTypedQuery (selections, true);
List<Book> lbooks = query.getResultList();
Any ideas?
Thanks
--
View this message in context:
http://cxf.547215.n5.nabble.com/How-to-select-specific-columns-to-retrieve-with-FIQL-using-JPATypedQueryVisitor-tp5729548p5729649.html
Sent from the cxf-user mailing list archive at Nabble.com.