-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Named Queries and non-managed Entities
PostPosted: Tue Dec 26, 2006 6:25 pm 
Beginner
Beginner

Joined: Tue Dec 20, 2005 9:40 pm
Posts: 20
Is it possible to set up a named query to simply return an array of object[]? I want to do something like:

<sql-query name="MyQuery">
<![CDATA[
select c.Name, sum(o.Amount) from Customer c
join Order o on c.ID = o.ID
]]>
</sql-query>

And get back basically a record set in the form of an array of type object[] (like this hql does:

select mother, offspr, mate.Name
from Eg.DomesticCat as mother
inner join mother.Mate as mate
left outer join mother.Kittens as offspr
)

However, it looks like with my sql-query I always have to specify an entity in the:

<return alias="customer" class="Customer"/>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.