-->
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: array in report query
PostPosted: Tue Feb 08, 2005 12:20 pm 
Newbie

Joined: Tue Jan 11, 2005 6:28 pm
Posts: 3
How can a report query be written that includes a array of primitives?

The mapping is :

<class name="Profile" table="Profile">
<id name="id" type="int">
<generator class="native" />
</id>
<property name="dept" type="string"/>
<property name="modified" type="timestamp" />
<primitive-array name="types" table="ProfileTypes" >
<key column="profileId"/>
<index column="ordinal"/>
<element column="type" type ="int"/>
</primitive-array>
...
</class>

A query like

"select p.id, elements(p.types) from Profile p where p.dept = ? order by p.id"

does return rows of id and type, but does not insure that the types are ordered by their index.


Would it help to rework the primitive-array as a List? It there a trick I am overlooking in the HQL?


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.