wood burning stoves 2.0*
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "select in hibernate" Watch "select in hibernate" New topic
Author

select in hibernate

Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118

Hi,

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



patient.hbm.xml



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
Bartender

Joined: Mar 24, 2008
Posts: 3817

And what your Patient class has?


SCJP 5 | SCWCD 5
[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


kunal
Atul Darne
Ranch Hand

Joined: Jul 05, 2009
Posts: 118

Hi kunal,

thanks it worked - i made the following changes

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: select in hibernate
 
Similar Threads
Common DAO layer Code Base - Hibernate Mapping XML changes
Read/Write BLOB in byte[] with Hibernate in MySQL..
HIBERNATE hql.ast.QuerySyntaxException: (table name) is not mapped
Hibernate mapping
Hibernate Issue