Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Data not inserted through Hibernate

 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am new to Hibernate.
I am trying to run a standalone application through Hibernate.
All is running fine. But data is not inserted in the table.

Can somebody tell me what may be the reasons that the data is not inserted into the table?

Thanks in advance,

Kousik
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you getting any exceptions? Is there any SQL being spouted out in your console?

This little entry in the configuration file will help you see any SQL being generated:



Are you beginning a transaction and then committing the transaction? Is the Java class added as a JPA annotated class to the AnnotationConfiguration object (if you're using JPA), or if you're not using JPA, is the class listed in the mappings section of the hibernate configuration file?

Here's a free tutorial about how to set up Hibernate with JPA. The Hibernate example uses MySQL and just the JDK, so it might point you in the right direction:

How to set up Hibernate on a Windows XP Machine - Stand Alone Java App

Don't get too frustrated before posting back. Struggle a bit, but don't be afraid to reach out for more help.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic