-->
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: Error in createNavtive query in jpa
PostPosted: Sat Oct 20, 2012 6:03 am 
Newbie

Joined: Sat Oct 20, 2012 5:53 am
Posts: 2
1 EntityManager em = factory.createEntityManager();
2 em.getTransaction().begin();

3 Query query = em.createNativeQuery("select user_id from user_info where name=? ",UserInfo.class)
.setParameter(1, "ram");

4 List <Long> result =(List<Long>)query.getResultList();
error line:->4

getting below errors .
Oct 20, 2012 3:30:29 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 0, SQLState: S0022
Oct 20, 2012 3:30:29 PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: Column 'Address' not found.


Top
 Profile  
 
 Post subject: Re: Error in createNavtive query in jpa
PostPosted: Sat Oct 20, 2012 6:34 am 
Newbie

Joined: Sat Oct 20, 2012 5:53 am
Posts: 2
THIS HAS BEEN DUE TO USERINFO.CLASS I REMOVED AND IT WORKS.
AS IT RETUEN OBJECT OF USERINFO CLASS.

3 Query query = em.createNativeQuery("select user_id from user_info where name=? ",UserInfo.class)
.setParameter(1, "ram");


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.