-->
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.  [ 3 posts ] 
Author Message
 Post subject: StringOutOfBound exception while execute session.iterate()
PostPosted: Mon Dec 08, 2003 3:52 pm 
Newbie

Joined: Thu Dec 04, 2003 11:59 am
Posts: 11
Any help will be greatly appreciated.
In my code, after create session, I am running the following code:

session.iterate("SELECT count(*) FROM data.Role");

And get the following error consistently:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java(Compiled Code))
at java.lang.String.substring(String.java(Compiled Code))
at net.sf.hibernate.sql.QuerySelect.toQueryString(QuerySelect.java:96)
at net.sf.hibernate.hql.QueryTranslator.renderSQL(QueryTranslator.java:465)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:119)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:358)
at net.sf.hibernate.impl.SessionFactoryImpl.getShallowQuery(SessionFactoryImpl.java:340)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1354)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1382)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1372)
at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1364)
at data.HibernateDataAccess.selectUser(HibernateDataAccess.java:98)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 08, 2003 7:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Bizarre!

Are you absolutely certain that data.Role is a mapped persistent class?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 09, 2003 3:30 pm 
Newbie

Joined: Thu Dec 04, 2003 11:59 am
Posts: 11
I am sure data.Role is a mapped persistent class.
I solved this problem just by chagning my hibernate version from 2.0.3 to 2.1. I don't know why but it is working now.
Thanks
George


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.