-->
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: Problem with named sql query
PostPosted: Tue Jul 05, 2005 3:40 pm 
Beginner
Beginner

Joined: Tue Jun 21, 2005 1:45 pm
Posts: 38
Hi,

Is it possible for a named sql query return Integer object?
Code:
   <sql-query name="findLogicalSequence">
      <return class="java.lang.Integer">
       </return>   
      select max(metaobjectno) + 1 as metaobjectno from metaobject where structureno = :structureno
   </sql-query>


I tried with above definition and as expected, it threw an exception as

Code:
Caused by: org.hibernate.MappingException: Unknown entity: java.lang.Integer
   at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:569)
   at org.hibernate.loader.custom.SQLQueryReturnProcessor.getSQLLoadable(SQLQueryReturnProcessor.java:53)
   at org.hibernate.loader.custom.SQLQueryReturnProcessor.processRootReturn(SQLQueryReturnProcessor.java:119)
   at org.hibernate.loader.custom.SQLQueryReturnProcessor.processReturn(SQLQueryReturnProcessor.java:98)
   at org.hibernate.loader.custom.SQLQueryReturnProcessor.process(SQLQueryReturnProcessor.java:87)
   at org.hibernate.loader.custom.SQLCustomQuery.<init>(SQLCustomQuery.java:105)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 05, 2005 3:47 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
First read this:

http://www.hibernate.org/ForumMailingli ... AskForHelp

Then this:

http://www.hibernate.org/hib_docs/v3/re ... medqueries


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.