Meaningless Drivel is fun!*
The moose likes Object Relational Mapping and the fly likes problem with showing records in hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "problem with showing records in hibernate" Watch "problem with showing records in hibernate" New topic
Author

problem with showing records in hibernate

shankhas sanyal
Ranch Hand

Joined: Jun 15, 2008
Posts: 45
hi all,
I am learning hibernate from scratch. so please guide me if i may be wrong.

i have a simple console based hibernate application that is being run on netbeans ide.

my hibernate.cfg.xml :




my emp.hbm.xml


my emp.java





my main.java (contains main method)



i have 5 records in the emp table. when i run this program. it show 5 times null.

output:






can anyone suggest how can i show the records and please guide me.

thanks
Shankha


I love this place!
shankhas sanyal
Ranch Hand

Joined: Jun 15, 2008
Posts: 45
i fixed this problem on my own with this piece of code



 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem with showing records in hibernate
 
Similar Threads
SQLGrammarException
SEVERE: Duplicate entry '1' for key 'PRIMARY'
Newbie got stuck in Hibernate "Hello World"
Problems with hibernate and mysql?
Not able to update or save a object to database. please help.