• 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 organize the file structure with ORM's

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a small problem which is that I don't really know how to organize my code in the best way possible with Hibernate.

I have Beans which are placed in package "model", then for each Bean I have a DAO.

Maybe it is easier to answer my question with the following question:

Which is the best way to organize the file structure when using Hibernate?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume you are primarily talking about the HBM files. The books I've read say it is common practice to place these files in the same package as your persisted classes (note that these could be DTO's and not straight Model objects, though the line between the 2 is thin.)

So if you have a com.foo.model.User.java you would have com.foo.model.User.hbm.xml.
 
reply
    Bookmark Topic Watch Topic
  • New Topic