I have the following configuration:
Code:
<hibernate-mapping>
<class name="com.contego.arx.domain.Host" table="hoststatus">
<id name="hostname" type="java.lang.String" column="host_name">
<generator class="assigned"/>
</id>
<property name="hostStatus" type="java.lang.String" column="host_status"/>
<property name="lastUpdate" type="java.util.Date" column="last_update"/>
<property name="lastCheck" type="java.util.Date" column="last_check"/>
<property name="lastStateChange" type="java.util.Date" column="last_state_change"/>
<property name="problemAcknowledged" type="java.lang.Boolean" column="problem_acknowledged"/>
<property name="timeUp" type="java.lang.Long" column="time_up"/>
<property name="timeDown" type="java.lang.Long" column="time_down"/>
<property name="timeUnreachable" type="java.lang.Long" column="time_unreachable"/>
<property name="lastNotification" type="java.util.Date" column="last_notification"/>
<property name="currentNotification" type="java.lang.Integer" column="current_notification"/>
<property name="notificationsEnabled" type="java.lang.Boolean" column="notifications_enabled"/>
<property name="eventHandlerEnabled" type="java.lang.Boolean" column="event_handler_enabled"/>
<property name="checksEnabled" type="java.lang.Boolean" column="checks_enabled"/>
<property name="pluginOutput" type="java.lang.String" column="plugin_output"/>
<property name="scheduledDowntimeDepth" type="java.lang.Integer" column="scheduled_downtime_depth"/>
<property name="flapDetectionEnabled" type="java.lang.Boolean" column="flap_detection_enabled"/>
<property name="isFlapping" type="java.lang.Boolean" column="is_flapping"/>
<property name="percentStateChange" type="java.lang.Double" column="percent_state_change"/>
<property name="failurePredictionEnabled" type="java.lang.Boolean" column="failure_prediction_enabled"/>
<property name="processPerformanceData" type="java.lang.Boolean" column="process_performance_data"/>
<set name="serviceStatuses" lazy="false">
<key column="host_name"/>
<one-to-many class="com.contego.arx.domain.Service"/>
</set>
</class>
</hibernate-mapping>
With this mapping the set whose name is "serviceStatuses" is not returning the correct information. One of the instances of Host has two instances of serviceStatuses but is only returning one.
I have crawled through Loader and OneToManyLoader and can't find the problem.
Apparently
Code:
OneToManyLoader.initizlize
is calling
Code:
Loader.loadCollection( SessionImplementer, Serializable, Type )
which in turn calls
Code:
Loader.loadCollection( SessionImplementor, Serializable[], Type[] )
then
Code:
Loader.doFind
.
Each of these methods appears to be performing correctly. However, as I mentioned, ultimately the collection is incorrect on the initial Host object.
Any help would be greatly appreciated.
Thanks!![/code]