Hibernate, DAO pattern and tree hierarchy
Hi all,
I use Hibernate for a short period of time and now I'm facing a complex problem . I try figure it out what is the best practice for the following scenario:
I have the following classes: Department, Team, Position, all of them inherited from a Entity class even there is almost no difference between them. But I wanted different classes for different entities.
I try to create a tree hierachy, each object is with all others in a bidirectional one-to-many relationship. For example a Department can have Teams and Positions as children and a Position can have Departments and Teams as children.
I created the mapping files and I don't know how to create all necessary methods without duplicating the code.
Questions:
1. Do I need a DAO pattern implemented for this design?
2. Can you recomend some documentation or ideas that will help me find out what is the best approach in this case?
Thanks

