Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

how to make 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

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 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 to function without the mapping file. Does anyone know which additional libraries I would need and / or how to achieve without mapping files?
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.
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic