-->
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: syntax to query a value-based collection element
PostPosted: Tue Feb 01, 2005 5:30 pm 
Newbie

Joined: Tue Jul 13, 2004 9:55 pm
Posts: 7
Location: Tucson, AZ
Can someone please post (or point me to the docs) the correct syntax for querying a value-based collection which is a property of an object? I've searched the documentation, HIA, google and I just can't find it!

elements() won't work for me because I'm using MySQL.

Using the example mapping doc below, I want to write a query that does this (just can't get the damn syntax right?!) nodeIdsSet is a value Set of longs

from org.tolweb.treegrow.main.NodeImage as img where img.nodeIdsSet.value in (1,2,3)

but the syntax for img.nodeIdsSet.value is what I can't figure out. Any help would be greatly appreciated.

Hibernate version:
2.1.5

Mapping documents:
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class
name="org.tolweb.treegrow.main.NodeImage"
table="Images"
dynamic-update="false"
dynamic-insert="false"
>
<cache usage="nonstrict-read-write" />
<id
name="id"
column="image_id"
type="int"
unsaved-value="-1"
>
<generator class="native">
</generator>
</id>
<property
name="copyrightOwner"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="copyright_owner"
/>

<property
name="copyrightEmail"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="copyright_email"
/>

<set
name="nodeIdsSet"
table="Images_To_Nodes"
lazy="false"
inverse="false"
cascade="none"
sort="unsorted"
>
<cache
usage="nonstrict-read-write"
/>

<key
column="image_id"
>
</key>

<element
column="node_id"
type="long"
not-null="false"
unique="false"
/>

</set>

</class>

</hibernate-mapping>




Name and version of the database you are using:
MySQL 4.0.16-standard

_________________
Danny Mandel <dmandel at nospam dot tolweb dot org>
Lead Programmer, Tree of Life Project
http://tolweb.org


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.