• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Where to see output of hbm2ddl?

 
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm trying to see the SQL queries generated by Hibernate persistence provider..I have this in my persistence.xml:


But I see no output in the server logs showing any SQL...
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The show.sql property is used for turning on and off the actual live SQL that is generated by Hibernate to store, retrieve and update objects in the underlying database. What you want is the DDL script that defines the database. I use an ANT task to run hbm2ddl that looks like this:



As you can see this exports the DDL script to a file named database-ddl.sql in the directory ${schema.dir}. But you may be able to set the DDL generation in the main hibernate configuration file too with the hibernate.hbm2ddl.auto property. Look HERE and search for hibernate.hbm2ddl.auto.
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for explaining that..but what I am really looking for is a way to see the the queries that are generated when I do something like

reply
    Bookmark Topic Watch Topic
  • New Topic