Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Non-entity inheritance results from a query

Just iterate over the list and create a new list with ProposalRow's from the
Proposal objects.

You could also use a constructor query in JPQL, "Select new
ProposalRow(p.id, p.name, ...) from Proposal p".



Mark Robinson-8 wrote:
> 
> Hi,
> 
> I'd like to be able to get non-entity results from a query.
> 
> What I have right now is a Proposal ( which is an entity) which is 
> extended by ProposalRow ( which is not an entity).  What I'd like to be 
> able to do is write
> 
> em.createQuery("select o from Proposal").getResultsList() and get a list 
> of ProposalRow's.  Proposal is *only* extended by this one class so it's 
> reasonable to have this set statically.
> 
> Does anyone have any ideas on how to do this?
> 
> Marl
> 
> -- 
> Mark Robinson - Mizar LLC
> mark.robinson@xxxxxxxxx
> 111-1010 McKenzie Ave.
> Victoria, BC
> V8X 4B2
> (250) 588-8321
> 
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Non-entity-inheritance-results-from-a-query-tp22838541p22848748.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top