• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When Table is Created in Hibernate When an xml file is initailzed or when a bean is called from DAO?

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I have a question that this is my xml file


and I have imported this file in my main.xml file like this


When I deploy are launch in my server then all Dao that are declared my tables are automatically create.before getting any call triggerd from DAO.

I want to know whethar its natural or Is there something wrong in my code which is triggering this?


Thanks
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From this this blog post:
create
Hibernate will create the database when the entity manager factory is created (actually when Hibernate's SessionFactory is created by the entity manager factory).

And this makes sense as well: your database tables must be available before you invoke your very first DAO method.
 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Roel De Nijs
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic