-->
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.  [ 2 posts ] 
Author Message
 Post subject: hql problem
PostPosted: Wed Oct 13, 2004 9:26 am 
Newbie

Joined: Tue Sep 14, 2004 8:59 am
Posts: 5
im trying to get all the users who have a specific book

i tryed all sorts of ways but i cant get anything but errors

i would think that something like
"from User u where u.bookshelf.booklines.book.isbn = 2222"

would work but i dosent.

a user have a bookshelf that contains booklines that contains a book

please help me get on from here


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 package="dk.bytenbog.model.businessobject">
<class name="User" table="USER">

<id name="username" type="string" column="user_id">
<generator class="assigned"/>
</id>
<property name="password" type="string" column="password"/>
<set name="messages" table="MESSAGES">
<key column="user_id"/>
<composite-element class="Message">
<property name="type" type="string" />
<many-to-one name="book" class="Book" />
<many-to-one name="user" class="User" />
</composite-element>
</set>

<component name="bookshelf" class="Bookshelf">
<set name="booklines" table="BOOK_LINES" cascade="all">
<key column="user_id"/>
<composite-element class="Bookline">
<many-to-one name="book" class="Book">
<column name="isbn"/>
</many-to-one>
<property name="date" type="date" column="date"/>
</composite-element>
</set>

</component>
</class>
<class name="Book" table="BOOK">
<id name="isbn" type="string" column="isbn">
<generator class="assigned"/>
</id>
<property name="title" type="string" column="title"/>
</class>
</hibernate-mapping>



Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 15, 2004 2:14 pm 
Beginner
Beginner

Joined: Fri Aug 13, 2004 3:07 pm
Posts: 44
I am not sure but I think you need to include this in quotes since the isbn is a string hence not anythin about your design reqts, is should be isbn='2222'

Hope this works !!!

_________________
Thanks
Sameet


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

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.