in fact I can't chose the field on the query, it only works when I choose the
field on the entitie manager like that:
OpenJPAEntityManager kem = OpenJPAPersistence.cast(em);
FetchPlan fetchPlan = kem.getFetchPlan();
fetchPlan.removeFetchGroup(FetchGroup.NAME_DEFAULT);
fetchPlan.clearFetchGroups();
fetchPlan.clearFields();
fetchPlan.addField(AbstractCustomer.class, "name");
fetchPlan.addField(AbstractCustomer.class, "orders");
fetchPlan.addField(Order.class, "status");
OpenJPAQuery q = OpenJPAPersistence
.cast(kem.createQuery("SELECT c FROM
AbstractCustomer c WHERE
c.customerId=:a"));
q.setParameter(1, 2);
Why it doesnt work on the OpenJPAQuery object ?
--
View this message in context:
http://openjpa.208410.n2.nabble.com/How-to-get-selective-columns-only-tp4197516p5316791.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.