• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to make hbm2ddl.auto work without a hbm.xml file

 
Ranch Hand
Posts: 820
IntelliJ IDE VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm used to doing hibernate with lots of mapping files.
Now, I've been working a web application using hibernate with annotations that has hbm2ddl.auto set to update. It works without any kind of *.hbm.xml mapping file because (I thought) all the entities are done with annotations.
it uses a persistence.xml ( and a data source defined in context.xml )



So, in a simple stand-alone hibernate test app with annotations, I would expect to be able to do the same thing. However, it requires a *.hbm.xml file
without one, the error is:
SEVERE: Error parsing XML: hibernate.cfg.xml(15) The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)". )

hibernate.cfg.xml is



So I'm thinking that in all the Hibernate / Seam / EJB / JPA libraries included with the Web application, there is something that allows the hbm2ddl.auto to function without the mapping file. Does anyone know which additional libraries I would need and / or how to achieve hbm2ddl.auto without mapping files?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I thought the "*" meant zero or more.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic