• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • Last Modified:

hibernate mapping

Hi experts,
I have a search form with 3 text fields and a dropdown list.  All the four fields come from different tables in the database. Forexample, CUSTOMER_NAME comes from a view, GFCID_TYPE_NAME comes from another viewm LEGAL_ENTITY_ID comes from a table, and BRANCH comes from a different table.
Because of this I am feeling difficult to figure out how to map them. If you have any questions please let me know. Thanks

<hibernate-mapping package="com.citi.idmgmt.poc" schema="CIF_PROD_OWNER">
    <class name="Search" table="">
        <id name="id" type="java.lang.Long" column="id">
            <generator class="native"/>
        <property name="legalEntityName" column="CUSTOMER_NAME" type="string"/>
        <property name="orgTypeCd" column="GFCID_TYPE_NAME" type="long"/>
        <property name="existingAccountNumber" column="LEGAL_ENTITY_ID" type="string"/>
        <property name="branch" column="BRANCH_NAME" type="string"/>
2 Solutions
Create your own view from that combine the 4 tables (use outer joins/inner joins whichever suits your needs).

Then use the VIEW to map the fields.
you need to create a mapping for each table.

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now