aspose file tools*
The moose likes JDBC and the fly likes Select all row values using JPA Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Select all row values using JPA" Watch "Select all row values using JPA" New topic
Author

Select all row values using JPA

Eswar Nec
Ranch Hand

Joined: May 02, 2010
Posts: 105
Hi,
I retrieve all records from table using JPA.
1. I use the following query.

The above line give the exception. The exception is
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: * near line 1, column 8 [SELECT * FROM samplejpa.entities.UMUserType]

2. But I use the follwing query, it will give the perfect result


Why the first one give the exception..What is difference between 1 & 2

Thanks in advance


Wake up! Don't let your smile be snatched away by anybody!
Regards, Eswar
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

The first one is not a JPA query, it's a native query.


[My Blog]
All roads lead to JavaRanch
Eswar Nec
Ranch Hand

Joined: May 02, 2010
Posts: 105
Thanks for your response.
 
jQuery in Action, 2nd edition
 
subject: Select all row values using JPA