Bonjour

Je travail actuellement sur un projet en me basant sur l'open source Itracker.
Pour les besoins de mon application j'ai besoin de mettre en place la suppression en cascade des enfants lorsque je supprime une ligne parent dans la base de données.

Je pensais que cela serais très simple mais après avoir écumer tout le web et essayer un certains nombre de solutions rien n'y fait ...

Je vous montre mon mapping en espérant que vous puissiez m'aider :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
 
  <class name="Issue" table="issuebean">
 
        <id name="id" unsaved-value="null">
            <column name="id" not-null="true"/>
            <generator class="native"/>
        </id>
 
        <property name="description">
            <column name="description" not-null="true"/>
        </property>
 
        <property name="severity" index="issuebeanSeverityIdx">
            <column name="severity" not-null="false"/>
        </property>
 
        <property name="status" index="issuebeanStatusIdx">
            <column name="status" not-null="false"/>
        </property>
 
        <property name="resolution" index="issuebeanResolutionIdx">
            <column name="resolution" not-null="false" />
        </property>
 
        <many-to-one name="project" class="Project" cascade="delete">
            <column name="project_id" not-null="true"/>
        </many-to-one>
 
        <many-to-one name="creator" class="User" cascade="delete" >
            <column name="creator_id" not-null="true"/>
        </many-to-one>
 
        <many-to-one name="owner" class="User" cascade="delete" >
            <column name="owner_id"/>
        </many-to-one>
 
        <many-to-one name="targetVersion" class="Version" cascade="delete" >
            <column name="target_version_id"/>
        </many-to-one>
 
        <property name="createDate" update="false">
            <column name="create_date" sql-type="timestamp" not-null="true"/>
        </property>
 
        <property name="lastModifiedDate">
            <column name="last_modified" sql-type="timestamp" not-null="false"/>
        </property>
 
        <property name="idClarify">
        	<column name="id_clarify" not-null="true"/>
        </property>
 
        <property name="statusClarify">
        	<column name="status_clarify" not-null="true"/>
        </property>
 
        <property name="priority">
        	<column name="priority" not-null="true"/>
        </property>
 
        <property name="type">
        	<column name="type" not-null="true"/>
        </property>
 
        <property name="fullDescription">
        	<column name="full_description" not-null="true"/>
        </property>
 
        <property name="desiredDateInternal">
        	<column name="desired_date_internal" sql-type="timestamp" not-null="false"/>        	
        </property>        
 
        <property name="theme">
        	<column name="theme" not-null="true"/>
        </property>
 
        <property name="desiredDate">
        	<column name="desiredDate" sql-type="timestamp" not-null="false"/>
        </property>
 
        <property name="severityClarify">
        	<column name="severity_clarify" not-null="true"/>
        </property>     
 
        <property name="flagDelete" >
        	<column name="flag_delete"/>
        </property>         
 
 
 
        <bag name="components" table="issue_component_rel" lazy="true">
            <key>
                <column name="issue_id"/>
            </key>
            <many-to-many class="Component" column="component_id" outer-join="auto"/>
        </bag>
 
        <bag name="versions" table="issue_version_rel" lazy="true">
            <key>
                <column name="issue_id"/>
            </key>
            <many-to-many class="Version" column="version_id" outer-join="auto"/>
        </bag>
 
        <bag name="notifications" table="notificationbean" cascade="all-delete-orphan" lazy="true" inverse="true">
            <key>
                <column name="issue_id"/>
            </key>
            <one-to-many class="Notification"/>
        </bag>
 
        <bag name="attachments" table="issueattachmentbean" cascade="all-delete-orphan" lazy="true" inverse="true">
            <key>
                <column name="issue_id"/>
            </key>
            <one-to-many class="IssueAttachment"/>
        </bag>
 
        <bag name="fields" table="issuefieldbean" cascade="all-delete-orphan" lazy="true" inverse="true">
            <key>
                <column name="issue_id"/>
            </key>
            <one-to-many class="IssueField"/>
        </bag>
 
        <bag name="history" table="issuehistorybean" cascade="all-delete-orphan" lazy="true" inverse="true">
            <key>
                <column name="issue_id"/>
            </key>
            <one-to-many class="IssueHistory"/>
        </bag>
 
        <bag name="relations" table="issuerelationbean" cascade="all-delete-orphan" lazy="true" inverse="true">
            <key>
                <column name="issue_id"/>
            </key>
            <one-to-many class="IssueRelation"/>
        </bag>
 
        <bag name="activities" table="issueactivitybean" cascade="delete" lazy="false" inverse="true">
            <key>
                <column name="issue_id" not-null="true"/>
            </key>
            <one-to-many class="IssueActivity"/>
        </bag>
 
    </class>
En vous remerciant par avance.
Rémi