-->
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: Limit number of entries in set
PostPosted: Fri Jan 14, 2005 1:35 am 
Newbie

Joined: Fri Jan 14, 2005 1:26 am
Posts: 1
Hibernate version: 2.1.6

Hibernate mapping: Blog

<hibernate-mapping default-cascade="save-update">
<class name="net.gatep5.weblog.Blog" table="BLOG">
<id name="id" column="ID">
<generator class="sequence">
<param name="sequence">blog_id_seq</param>
</generator>
</id>
<timestamp name="date" column="date" />
<property name="subject" column="subject" type="string" not-null="true" unique="true"/>
<set name="entries" inverse="true" order-by="id desc" lazy="true" cascade="all" table="entry" >
<key column="blog_id"/>
<one-to-many class="net.gatep5.weblog.Entry" />
</set>
</class>
</hibernate-mapping>


Database: Postgresql


I have a blog hibernate mapping that contains a <set> element that links to the blog entries that correspond to the blog id. What I would like to do is when the blog object is created in the session it only contains a set of 5 entry objects but I would like to specify the offset value in a request parameter. So basically I am trying to pass a request paramenter to the hibernate mapping for my blog entity so that the whole set of entries is not requested but only the 5 that I am looking for. Is this even possible?

Thanks for your help in advance!


Top
 Profile  
 
 Post subject: Re: Limit number of entries in set
PostPosted: Mon Jul 27, 2009 4:17 pm 
Newbie

Joined: Mon Jul 23, 2007 11:58 am
Posts: 15
Location: New Jersey
I have the same requirement, and so far I have not been able to google a solution...i think my problem is that Hiberante has the where attribute on colllection elements, but a database like mysql uses the limit keyword, and that does not belong in the where clause...anyone have any suggestions?


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.