title: Conditional Join in Hibernate
body: <p>Here is what I am doing:
  Their is table MEDIA against this their are multiple entries in MEDIA_TAGS table. So based on some user input for media tags I have to fetch the MEDIA table records. So here I have to join the tables MEDIA and MEDIA_TAGS only when their is input for the media tags. </p>
  
  <p>Since it is legacy system I cant modify the existing mapping in hbm file. 
  I wanted to know if their is any functionality in Hibernate to add the join on some another table based on certain condition or dynamic input.</p>
  
  <p>Does this possible with predefined filters or is their any way to achieve this in hibernate mapping.  Any pointers on this greatly help me.</p>