on the projet mapping file declare
<bag name="modules" table="tbl_projectmodule" cascade="all">
<key column="projectId"/>
<many-to-many column="moduleId" class="module"/>
</bag>
you'll be able to do myProjet.getModules() --> return the list
on the
module mapping file declare
<bag name="projects" table="tbl_projectmodule" cascade="all">
<key column="moduleId"/>
<many-to-many column="projectId" class="project"/>
</bag>
you'll be able to do myModule.getProjects() --> return the list
http://www.hibernate.org/hib_docs/refer ... tions-s1-5
Now optimize it with lazy attribute, secure it with cascase attribute...
you don't need a 'ProjectAndModule' class since the association table doesn't have any extra info for example...