-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: CollectionOfElements and Callbacks
PostPosted: Wed Aug 13, 2008 10:43 am 
Newbie

Joined: Thu Jul 10, 2008 7:09 am
Posts: 3
Hi,

I have a CollectionOfElements mapping, but I am not able to use classbacks with it:

Code:
@Embeddable
public MyEmbClass implements Serializable {
}

@Entity
public MyClass implements Serializable {
@CollectionOfElements
private List<MyEmbClass> embs;


If I use PreUpdate/PostUpate in MyEmbClass, they will be not called (makes sense, once this annotations are used for Entitys)
But if I use PreUpdate/PostUpate in MyClass, they will not be called also, once the "Entity is not being update", just elements of a collection.

How can I use a Callback for a CollectionOfElements?

Thx in advance


============================
hibernate-entitymanager 3.3.1
hibernate-annotations 3.3.0
hibernate-3.2.6


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 14, 2008 10:25 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

have you implemented equals() and hashCode() for MyEmbClass? If not you have to do it and compare all properties of your embeddable (component) class. Hibernate uses equals to determine modifications.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.