-->
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: Set Max Results Index out of range exception on getQuery
PostPosted: Wed Jun 08, 2005 10:48 am 
Newbie

Joined: Wed Jun 01, 2005 11:00 am
Posts: 17
Location: UK
Hello All,
Noticed a problem with the set Max Results method on the get named query method of session. It executes fine and generates sql if I dont
call the max results method. Just thought I should flag it up somewhere.
Cheers,
Ben

Hibernate version:
hibernate 3.5

Mapping documents:
<hibernate-mapping>

<class name="com.du.ezmarket.business.marketbasket.MarketBasketImpl" table="tblmarketbasket">
<id name="baseId" column="id">
</id>
<property name="name" />
<property name="description"/>

</class>

<sql-query name="findBasketsByHeaderId">
<return alias="marketbasket" class="com.du.ezmarket.business.marketbasket.MarketBasketImpl"/>
SELECT
tblmarketbasket.ID AS {marketbasket.baseId},
tblmarketbasket.NAME AS {marketbasket.name},
tblmarketbasket.description AS {marketbasket.description}
FROM tblmarketbasket WHERE tblmarketbasket.FK_AUCTIONHEADERID=10001
</sql-query>

</hibernate-mapping>

Full stack trace of any exception that occurs:
[08/06/05 14:42:26:656 GMT] 47f847f8 SystemErr R java.lang.StringIndexOutOfBoundsException: String index out of range: -1
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at java.lang.Throwable.<init>(Throwable.java)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at java.lang.Throwable.<init>(Throwable.java:68)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at java.lang.StringIndexOutOfBoundsException.<init>(StringIndexOutOfBoundsException.java:67)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at java.lang.String.substring(String.java)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at org.hibernate.dialect.DB2Dialect.getLimitString(DB2Dialect.java:200)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at org.hibernate.dialect.Dialect.getLimitString(Dialect.java:581)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1073)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at org.hibernate.loader.Loader.doQuery(Loader.java:365)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:206)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at org.hibernate.loader.Loader.doList(Loader.java:1515)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at org.hibernate.loader.Loader.list(Loader.java:1498)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:103)
[08/06/05 14:42:26:687 GMT] 47f847f8 SystemErr R at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1340)
[08/06/05 14:42:26:703 GMT] 47f847f8 SystemErr R at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:151)

Name and version of the database you are using:
DB2
The generated SQL (show_sql=true):
None it did not get that far




[code][/code]


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.