Advertisement

04.02.2008 at 01:27PM PDT, ID: 23290791
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

EJB 3.0 Delete Casade problem

Asked by kmapper in BEA WebLogic Application Server, J2EE, Enterprise Java Beans (EJB)

Tags: ,

Hi

Look at the attached code...  when I delete an KMapEntity, the KMapLink of this entity are not deleted... Can somebody tell why why?

thank youStart Free Trial
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:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:
369:
370:
371:
372:
373:
374:
375:
376:
377:
378:
379:
380:
381:
382:
383:
384:
385:
386:
387:
388:
389:
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
 
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
 
/**
 * KMapEntity generated by MyEclipse Persistence Tools
 */
@Entity
@Table(name = "KMPT31_KMAP_ENTIT", uniqueConstraints = {})
public class KMapEntity implements java.io.Serializable {
 
	// Fields
 
	private Long kmapEntityId;
	private Instance instance;
	private KMap kMap;
	private InstanceType instanceType;
	private Long level;
	private Long xpos;
	private Long ypos;
	private Date createdDate;
	private Date modifiedDate;
	private Date deletedDate;
	private Set<KMapLink> kmapLinksForKmapEntityIdTarget = new HashSet<KMapLink>(
			0);
	private Set<KMapLink> kmapLinksForKmapEntityIdSource = new HashSet<KMapLink>(
			0);
 
	// Constructors
 
	/** default constructor */
	public KMapEntity() {
 
	}
 
	/** minimal constructor */
	public KMapEntity(Long kmapEntitId, KMap kmap, Long xpos, Long ypos) {
 
		this.kmapEntityId = kmapEntitId;
		this.kMap = kmap;
		this.xpos = xpos;
		this.ypos = ypos;
	}
 
	/** full constructor */
	public KMapEntity(Long kmapEntitId, Instance instance, KMap kmap,
			InstanceType instanceType, Long level, Long xpos, Long ypos,
			Set<KMapLink> kmapLinksForKmapEntityIdTarget,
			Set<KMapLink> kmapLinksForKmapEntityIdSource) {
 
		this.kmapEntityId = kmapEntitId;
		this.instance = instance;
		this.kMap = kmap;
		this.instanceType = instanceType;
		this.level = level;
		this.xpos = xpos;
		this.ypos = ypos;
		this.kmapLinksForKmapEntityIdTarget = kmapLinksForKmapEntityIdTarget;
		this.kmapLinksForKmapEntityIdSource = kmapLinksForKmapEntityIdSource;
	}
 
	// Property accessors
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_KMPT31")
	@SequenceGenerator(name = "SEQ_KMPT31", sequenceName = "seq_kmpt31_id", allocationSize = 1)
	@Column(name = "kmap_entit_id", unique = true, nullable = false, insertable = true, updatable = true)
	public Long getKmapEntityId() {
 
		return this.kmapEntityId;
	}
 
	public void setKmapEntityId(Long kmapEntitId) {
 
		this.kmapEntityId = kmapEntitId;
	}
 
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "INSTA_ID", unique = false, nullable = true, insertable = true, updatable = true)
	public Instance getInstance() {
 
		return this.instance;
	}
 
	public void setInstance(Instance instance) {
 
		this.instance = instance;
	}
 
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "KMAP_ID", unique = false, nullable = false, insertable = true, updatable = true)
	public KMap getKMap() {
 
		return this.kMap;
	}
 
	public void setKMap(KMap kmap) {
 
		this.kMap = kmap;
	}
 
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "INSTA_TYPE_ID", unique = false, nullable = true, insertable = true, updatable = true)
	public InstanceType getInstanceType() {
 
		return this.instanceType;
	}
 
	public void setInstanceType(InstanceType instanceType) {
 
		this.instanceType = instanceType;
	}
 
	@Column(name = "LVL", unique = false, nullable = true, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getLevel() {
 
		return this.level;
	}
 
	public void setLevel(Long lvl) {
 
		this.level = lvl;
	}
 
	@Column(name = "XPOS", unique = false, nullable = false, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getXpos() {
 
		return this.xpos;
	}
 
	public void setXpos(Long xpos) {
 
		this.xpos = xpos;
	}
 
	@Column(name = "YPOS", unique = false, nullable = false, insertable = true, updatable = true, precision = 22, scale = 0)
	public Long getYpos() {
 
		return this.ypos;
	}
 
	public void setYpos(Long ypos) {
 
		this.ypos = ypos;
	}
 
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "kmapEntityByKmapEntityIdTarget")
	public Set<KMapLink> getKmapLinksForKmapEntityIdTarget() {
 
		return this.kmapLinksForKmapEntityIdTarget;
	}
 
	public void setKmapLinksForKmapEntityIdTarget(
			Set<KMapLink> kmapLinksForKmapEntityIdTarget) {
 
		this.kmapLinksForKmapEntityIdTarget = kmapLinksForKmapEntityIdTarget;
	}
 
	@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER, mappedBy = "kmapEntityByKmapEntityIdSource")
	public Set<KMapLink> getKmapLinksForKmapEntityIdSource() {
 
		return this.kmapLinksForKmapEntityIdSource;
	}
 
	public void setKmapLinksForKmapEntityIdSource(
			Set<KMapLink> kmapLinksForKmapEntityIdSource) {
 
		this.kmapLinksForKmapEntityIdSource = kmapLinksForKmapEntityIdSource;
	}
 
	@Temporal(TemporalType.DATE)
	@Column(name = "creat_date", unique = false, nullable = true, insertable = true, updatable = true, length = 29)
	public Date getCreatedDate() {
 
		return this.createdDate;
	}
 
	public void setCreatedDate(Date creatDate) {
 
		this.createdDate = creatDate;
	}
 
	@Temporal(TemporalType.DATE)
	@Column(name = "modif_date", unique = false, nullable = false, insertable = true, updatable = true, length = 29)
	public Date getModifiedDate() {
 
		return this.modifiedDate;
	}
 
	public void setModifiedDate(Date modifDate) {
 
		this.modifiedDate = modifDate;
	}
 
	@Temporal(TemporalType.DATE)
	@Column(name = "delet_date", unique = false, nullable = true, insertable = true, updatable = true, length = 29)
	public Date getDeletedDate() {
 
		return this.deletedDate;
	}
 
	public void setDeletedDate(Date deletDate) {
 
		this.deletedDate = deletDate;
	}
 
}
 
************************************************************************************
 
package ca.rddc.kmapper.ejb3.entity;
 
import java.util.Date;
 
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
 
/**
 * KMapLink generated by MyEclipse Persistence Tools
 */
@Entity
@Table(name = "KMPT34_KMAP_LINK", uniqueConstraints = {})
public class KMapLink implements java.io.Serializable {
 
	// Fields
 
	private Long kmapLinkId;
	private Association association;
	private Relation relation;
	private KMapEntity kmapEntityByKmapEntityIdSource;
	private KMapEntity kmapEntityByKmapEntityIdTarget;
	private Date createdDate;
	private Date modifiedDate;
	private Date deletedDate;
 
	// Constructors
 
	/** default constructor */
	public KMapLink() {
 
	}
 
	/** minimal constructor */
	public KMapLink(Long kmapLinkId, KMapEntity kmapEntityByKmapEntityIdSource,
			KMapEntity kmapEntityByKmapEntityIdTarget) {
 
		this.kmapLinkId = kmapLinkId;
		this.kmapEntityByKmapEntityIdSource = kmapEntityByKmapEntityIdSource;
		this.kmapEntityByKmapEntityIdTarget = kmapEntityByKmapEntityIdTarget;
	}
 
	/** full constructor */
	public KMapLink(Long kmapLinkId, Association association, Relation relation,
			KMapEntity kmapEntityByKmapEntityIdSource,
			KMapEntity kmapEntityByKmapEntityIdTarget) {
 
		this.kmapLinkId = kmapLinkId;
		this.association = association;
		this.relation = relation;
		this.kmapEntityByKmapEntityIdSource = kmapEntityByKmapEntityIdSource;
		this.kmapEntityByKmapEntityIdTarget = kmapEntityByKmapEntityIdTarget;
	}
 
	// Property accessors
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_KMPT34")
	@SequenceGenerator(name = "SEQ_KMPT34", sequenceName = "seq_kmpt34_id", allocationSize = 1)
	@Column(name = "kmap_link_id", unique = true, nullable = false, insertable = true, updatable = true)
	public Long getKmapLinkId() {
 
		return this.kmapLinkId;
	}
 
	public void setKmapLinkId(Long kmapLinkId) {
 
		this.kmapLinkId = kmapLinkId;
	}
 
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "ASOCT_ID", unique = false, nullable = true, insertable = true, updatable = true)
	public Association getAssociation() {
 
		return this.association;
	}
 
	public void setAssociation(Association association) {
 
		this.association = association;
	}
 
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "RELTN_ID", unique = false, nullable = true, insertable = true, updatable = true)
	public Relation getRelation() {
 
		return this.relation;
	}
 
	public void setRelation(Relation relation) {
 
		this.relation = relation;
	}
 
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "KMAP_ENTIT_ID_SOURC", unique = false, nullable = false, insertable = true, updatable = true)
	public KMapEntity getKmapEntityByKmapEntityIdSource() {
 
		return this.kmapEntityByKmapEntityIdSource;
	}
 
	public void setKmapEntityByKmapEntityIdSource(
			KMapEntity kmapEntityByKmapEntityIdSource) {
 
		this.kmapEntityByKmapEntityIdSource = kmapEntityByKmapEntityIdSource;
	}
 
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumn(name = "KMAP_ENTIT_ID_TARGT", unique = false, nullable = false, insertable = true, updatable = true)
	public KMapEntity getKmapEntityByKmapEntityIdTarget() {
 
		return this.kmapEntityByKmapEntityIdTarget;
	}
 
	public void setKmapEntityByKmapEntityIdTarget(
			KMapEntity kmapEntityByKmapEntityIdTarget) {
 
		this.kmapEntityByKmapEntityIdTarget = kmapEntityByKmapEntityIdTarget;
	}
 
	@Temporal(TemporalType.DATE)
	@Column(name = "creat_date", unique = false, nullable = true, insertable = true, updatable = true, length = 29)
	public Date getCreatedDate() {
 
		return this.createdDate;
	}
 
	public void setCreatedDate(Date creatDate) {
 
		this.createdDate = creatDate;
	}
 
	@Temporal(TemporalType.DATE)
	@Column(name = "modif_date", unique = false, nullable = false, insertable = true, updatable = true, length = 29)
	public Date getModifiedDate() {
 
		return this.modifiedDate;
	}
 
	public void setModifiedDate(Date modifDate) {
 
		this.modifiedDate = modifDate;
	}
 
	@Temporal(TemporalType.DATE)
	@Column(name = "delet_date", unique = false, nullable = true, insertable = true, updatable = true, length = 29)
	public Date getDeletedDate() {
 
		return this.deletedDate;
	}
 
	public void setDeletedDate(Date deletDate) {
 
		this.deletedDate = deletDate;
	}
 
}
[+][-]04.03.2008 at 12:02AM PDT, ID: 21270194

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: BEA WebLogic Application Server, J2EE, Enterprise Java Beans (EJB)
Tags: Java, Weblogic 10.0
Sign Up Now!
Solution Provided By: dejanpazin
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.03.2008 at 06:33AM PDT, ID: 21272414

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 07:09AM PDT, ID: 21272801

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 07:12AM PDT, ID: 21272844

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 07:51AM PDT, ID: 21273272

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]04.03.2008 at 07:51AM PDT, ID: 21273282

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.03.2008 at 08:34AM PDT, ID: 21273710

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.29.2008 at 11:58AM PDT, ID: 22348249

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 06:27PM PDT, ID: 22373317

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 - Hierarchy / EE_QW_2_20070628