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.  [ 1 post ] 
Author Message
 Post subject: Events for <composite-element>s
PostPosted: Wed Jan 04, 2006 2:41 pm 
Newbie

Joined: Wed Jan 04, 2006 2:18 pm
Posts: 1
Hi,

Using the LoadEventListener I get notified if an entity is loaded from persistent storage. However, I do not get a notification if an element (composite-element) of a set is loaded. Is there a way to get events for each single element of a collection? I could use the InitializeCollectionEventListener, access the collection thru the event parameter in the listener method, then apply an instanceof check to find out the type of collection an then iterate over each element, but I am looking for a smoother way to do this (preferably I get en event for each element in the collection when it is loaded).

I get a load event when Person object is loaded, but not when a PhoneNumber is loaded.


Thank you for any help
--bruno

Hibernate version:3.1

Mapping documents:
<hibernate-mapping package="ch.hsr.myapp">
<class name="Person" table="People" lazy="false">
<id name="ID" type="long" unsaved-value="null">
<column name="ID" not-null="true"/>
<generator class="sequence">
<param name="sequence">S_People</param>
</generator>
</id>

<property name="lastName" not-null="true"/>
<property name="firstName" not-null="true"/>
<property name="nickname"/>
<property name="birthDate"/>
<property name="notes">
<column name="Notes" sql-type="text"/>
</property>

<component name="address">
<property name="street" column="Street"/>
<property name="streetNumber" column="StreetNo"/>
<property name="ZIPCode" column="ZIPCode"/>
<property name="region" column="Region"/>
<property name="country" column="Country"/>
</component>

<set name="phones" table="PersPhones" lazy="false" cascade="all-delete-orphan">
<key column="PersID"/>
<composite-element class="PhoneNumber">
<property name="country"/>
<property name="region"/>
<property name="localNumber"/>
</composite-element>
</set>
</class>
</hibernate-mapping>

Name and version of the database you are using:PostgreSQL 8.x


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

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.