• Post Reply Bookmark Topic Watch Topic
  • New Topic

Programatic Schema Export with Hibernate and EJB3

Rajasekar Elango
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing J2SE Application with Hibernate and HSQL database and I want db schema to be created programatically.

I following EJB3 - JPA approach and using persistence.xml as show below.

To Use SchemaExport API, I need hibernate configuration, so I am trying to get hibernate cfg out of EJB 3 configuration. This is what I tried..

SEVERE: Error parsing XML: /META-INF/persistence.xml(1) Document is invalid: no grammar found.

Please help me in knowing right way of exporting schema using EJB3/hibernate. My basic requirement is tables to be created automatically only if they does not exist, Please let me know if there are better way of doing it...

Any help would be very much appreciated..

Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!