A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Mongo DB Applied Patterns
this week in the
MongoDB
forum
or a resume review from
Five Year Itch
in the
Jobs Discussion
forum!
JavaRanch
»
Java Forums
»
Databases
»
Object Relational Mapping
Author
How to create query with jpa, getting exception
Pramod Kumar
Ranch Hand
Joined: Oct 05, 2007
Posts: 40
posted
Oct 08, 2007 03:47:00
0
Hi,
I am using the following query to access the db values in to the list
Query qury = em.createQuery("SELECT usr FROM User");
List<User> results = (List <User>
qury.getResultList();
User is a bean mapped to user table.
I am getting the follwing exception
java.lang.IllegalStateException
: No data type for node: org.hibernate.hql.ast.tree.IdentNode
\-[IDENT] IdentNode: 'usr ' {originalText=usr}
Thanks,
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
52
I like...
posted
Oct 08, 2007 04:03:00
0
Query qury = em.createQuery("SELECT usr FROM User");
Change it to
Query qury = em.createQuery("SELECT usr FROM User [B]usr[/B]");
The alias usr wasn't defined
[
My Blog
] [
JavaRanch Journal
]
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
52
I like...
posted
Oct 08, 2007 04:06:00
0
"ngpramod ngpramod"
Please check your
private message
, for a message from JavaRanch.
I agree. Here's the link:
http://zeroturnaround.com/jrebel/download
subject: How to create query with jpa, getting exception
Similar Threads
org.hibernate.QueryException: Expected positional parameter count: 2, actual parameters: [1]
SelectItems + IllegalArgumentException + help
java.lang.NoClassDefFoundError: org/apache/tomcat/util/buf/B2CConverter
entityManager executing statements on system tables?
Tomcat 6 + jdbc + Oracle
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter