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

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

 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • 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?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, I thought the "*" meant zero or more.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic