3 Replies Latest reply on Jan 18, 2013 1:16 PM by gimbal2

    joining table in hibernate


      I have a requirement where I have to fetch the data from 2 table.
      table1 structure
      profileiId, name, address,........ there are some more elements (profile id is primary key)
      profileid, key there will be multiple key for a profileid. both columns make composite key.
      I have a hbm file
      <class name="Test" table="Table1">
              <id name="profileId" column="PROFILE_ID" type="string" unsaved-value="undefined">
                     <meta attribute="SCIguid"/>
                <property name="name" column="NAME" type="string" unique="true"/>
                <property name="address" column="ADDRESS" type="String"/>
      I have to enhance this xml file to join table2 based on profileid and take all the keys in a List.
      Something like
      <property name="list" column="KEY" type="LIST" unique="true" table="table2" /> //join based on profileid
      Thanks for the help

      Edited by: 821458 on Jan 18, 2013 4:56 AM