• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to organize the file structure with ORM's

 
Henrik Engert
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • 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?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic