The moose likes Object Relational Mapping and the fly likes select in hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "select in hibernate" Watch "select in hibernate" New topic

select in hibernate

Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118


I have acheived adding contents to a database table by using hibernate xml hbm file, now i wish to search any user in it - i am stucked with with an error in the code

iam having the following function

cfg file


i get the below error

when i do a select query on the table

Regards, Atul.
I came to this world on a Learner's License
Vijitha Kumara

Joined: Mar 24, 2008
Posts: 3816

And what your Patient class has?

[How to ask questions] [Twitter]
Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118

Hi Vijitha ,

I am adding the class

Kunal Lakhani
Ranch Hand

Joined: Jun 05, 2010
Posts: 622
String SQL_QUERY ="from patientdetails.id,patientdetails.firstname";

I think it should be

When you write HQL, you concentrate on Objects and its properties without concerning about the database

Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118

Hi kunal,

thanks it worked - i made the following changes

I agree. Here's the link: http://aspose.com/file-tools
subject: select in hibernate
Similar Threads
Common DAO layer Code Base - Hibernate Mapping XML changes
HIBERNATE hql.ast.QuerySyntaxException: (table name) is not mapped
Hibernate mapping
Hibernate Issue
Read/Write BLOB in byte[] with Hibernate in MySQL..