Results 1 to 3 of 3

Thread: Spring Hibernate problem

  1. #1

    Default Spring Hibernate problem

    hi all,
    i am new to spring hibernate ,
    i have one problem i have one table like emp and i map the emp department into another table but when i load the emp information on respective page at that time i have to show he's respective department but when i call the page then data of my department table is deleted why this happen i dont understand anything of that

    also i map the dept of emp in emp.hbm.xml as set like this
    <set name="dept" table="emp_dept" cascade="all-delete-orphan" fetch="select" lazy="false" inverse="true">
    <key>
    <column name="EMP_ID">
    <comment></comment>
    </column>
    </key>
    <many-to-many column="DEPT_ID" class="com.test.entity.DEPT"/>
    </set>
    please help me
    please reply
    thanks in advance
    Thanks,
    Parag

  2. #2
    Join Date
    Sep 2008
    Location
    London, UK
    Posts
    155

    Default

    Please provide more information, i.e. how do you retrieve the data? What's your dao looking like?

    G

  3. #3
    Join Date
    Sep 2008
    Location
    Hyderabad
    Posts
    27

    Wink

    Hi,
    May be the problem is with cascade="all-delete-orphan".

    Try cascade="all".
    Thanks,
    K. Siva Prasad Reddy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •