users@glassfish.java.net

RE: CascadeType.PERSIST

From: Kenneth Clark <kenneth.clark_at_skyetech.co.za>
Date: Fri, 2 Nov 2007 15:31:11 +0200

If I manually set the id for the nested objects it works. Is this the
correct way to do it?

 

 

________________

Thanks and regards

 

Kenneth Clark

Solutions Engineer

 

ShadowLogo.png

Tel: 27 11 679 3075

Mobile: 27 (0) 84 583 1348

Email: HYPERLINK
"mailto:kenneth.clark_at_skyetech.co.za"kenneth.clark_at_skyetech.co.za

Website: http://www.skyetech.co.za

 

From: Kenneth Clark [mailto:kenneth.clark_at_skyetech.co.za]
Sent: 02 November 2007 15:19
To: users_at_glassfish.dev.java.net
Subject: CascadeType.PERSIST

 

Hi all

 

I have entity class that contain a @PrePersist method which sets the id of
the object before sending it to the database.

 

Now I have and object

Public class ClientProfile{}

Which contains a reference to a collection of type

Public class Subscription{}

 

But when I try and pass the object to the app server with the
ClientProfile.SubscriptionCollection populated it does not want to create an
id for the items inside the SubscriptionCollection even though the
Subscription class defines the @PrePersist.

 

Any Ideas on why? Do I have to manually set the id’s of the objects inside
the collection?

 

________________

Thanks and regards

 

Kenneth Clark

Solutions Engineer

 

ShadowLogo.png

Tel: 27 11 679 3075

Mobile: 27 (0) 84 583 1348

Email: HYPERLINK
"mailto:kenneth.clark_at_skyetech.co.za"kenneth.clark_at_skyetech.co.za

Website: http://www.skyetech.co.za

 

 

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.18/1104 - Release Date: 2007/11/01
18:47

 

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.18/1104 - Release Date: 2007/11/01
18:47


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.18/1104 - Release Date: 2007/11/01
18:47
 
    





image001.png
(image/png attachment: image001.png)

image002.png
(image/png attachment: image002.png)