users@glassfish.java.net

CascadeType.PERSIST

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

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
 
  





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