-->
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.  [ 5 posts ] 
Author Message
 Post subject: wierd exception from hibernate
PostPosted: Fri Aug 12, 2005 11:23 am 
Newbie

Joined: Fri Aug 12, 2005 11:18 am
Posts: 2
select (max(cast(employer_num as bigint)) + 1) as NextNum from Employer where client_id = 97 and isNumeric(employer_num) = 1

this statement works in sql but hibernate is throwing exception like ( expected before).

any ideas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 11:33 am 
Regular
Regular

Joined: Thu May 26, 2005 2:08 pm
Posts: 99
Are you trying to convert this to HQL or run it as a SQLQuery?

Also, pay special attention to the sections in the posting form that ask for your code, the SQL generated, and stack traces.


Quote:
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 11:39 am 
Newbie

Joined: Fri Aug 12, 2005 11:18 am
Posts: 2
I am new to hibernate and i am trying to run this as getHibernateTemplate().find()


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 11:41 am 
Expert
Expert

Joined: Thu Dec 04, 2003 12:36 pm
Posts: 275
Location: Bielefeld, Germany
Post your code as well as the exception.

Best regards
Sven

_________________
Please don't forget to give credit, if this posting helped to solve your problem.


Top
 Profile  
 
 Post subject: re: weird exception
PostPosted: Fri Aug 12, 2005 1:07 pm 
Newbie

Joined: Mon Mar 21, 2005 12:52 pm
Posts: 11
Location: Chicago, Il
I would venture a guess that hibernate is probably trying to parse that to HQL.

http://www.hibernate.org/hib_docs/v3/reference/en/html/querysql.html#querysql-namedqueries

contains some information that might be helpful in this case. If you want just a single integer value returned, then using a named query might be the way to go.

_________________
where's my coffee mug?


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