hibernate mapping

Posted on 2006-04-10
Last Modified: 2013-11-24
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="" 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"/>
Question by:KirtipurItagol
    LVL 5

    Accepted Solution

    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.
    LVL 92

    Assisted Solution

    you need to create a mapping for each table.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now