title: struts2 Createcriteria
body: <p>I have parent/child relationship with Activities/Favorites now i want to display from parent table where company not equal to 'xyz' and child table where company equal to 'xyz'</p>
  
  <p>i.e A jsp is displayed with all records where parent company is not equal to 'xyz'(which is users companyid who logged in) and with checkbox from child table. when user selects checkbox it stores the parentid, the users company id and checkbox value which is true in child table.</p>
  
  <p>so there is a possibliyt one acitivy might have more than one child record with same parentid and diffrent company name.</p>
  
  <p>Could any one please help me how to acheive in hibernate. I have tried using
      session.createQuery("from Activities where upper(COMPANY)&lt;>'" + userCompany +"' and accNominated='true'").list();</p>
  
  <p>but it is dispalying parent record and all the child records with that parentid. But i want to display parent records and all the child records with same activityid and ifferent companies which are checked  but not respective to company who logged in.</p>
  
  <p>thanks</p>