Announcement Announcement Module
Collapse
No announcement yet.
Spring Hibernate problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Please provide more information, i.e. how do you retrieve the data? What's your dao looking like?

    G

    Comment


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

      Try cascade="all".

      Comment

      Working...
      X