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: Auditing issue with idbags and IInterceptor
PostPosted: Wed Nov 09, 2005 4:45 pm 
Newbie

Joined: Fri Sep 30, 2005 1:31 pm
Posts: 12
The issue is this. We have an interceptor setup which audits just fine except when I'm adding or removing objects from an idbag. I have a CaseCount object with two idbags of CountItems and CountActions. When I call a CaseCount.CountItems.Remove() and then SaveOrUpdate(CaseCount), no events are fired, therefore no auditing records are created. Unfortunately our app requires auditing at this level. Can this be done?

Here is my map with 2 bags.
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
   <class name="SurgeryHibernate.Domain.CaseCount, SurgeryHibernate" table="sg_case_count">
      <id name="Id" column="key_case_count" type="Int32" unsaved-value="0">
         <generator class="sequence">
            <param name="sequence">sg_case_count_seq</param>
         </generator>
      </id>
      <property name="CaseNumber" column="casenumber" type="String" length="20"/>
      <property name="TimeStamp" column="timestamp" type="DateTime"/>
      <property name="AllCountsCorrect" column="all_counts_correct" type="Boolean"/>

    <bag name="CountPersonnel" table="sg_case_count_personnel">
      <key column="key_case_count"/>
      <many-to-many class="SurgeryHibernate.Domain.CasePersonnel, SurgeryHibernate" column="key_case_personnel"/>
    </bag>

    <idbag name="CountItems" table="sg_case_count_item" cascade="delete">
      <collection-id column="key_case_count_item" type="Int32">
        <generator class="sequence">
          <param name="sequence">sg_case_count_item_seq</param>
        </generator>
      </collection-id>
      <key column="key_case_count"/>
      <composite-element class="SurgeryHibernate.Domain.CaseCountItem, SurgeryHibernate">
        <parent name="CaseCount"/>
        <property name="CountCorrect" column="count_correct" type="Boolean"/>
        <many-to-one name="CountItem" class="SurgeryHibernate.Domain.CountItem, SurgeryHibernate" column="key_count_item" outer-join="true"/>
      </composite-element>
    </idbag>

    <idbag name="CountActions" table="sg_case_count_action" cascade="delete">
      <collection-id column="key_case_count_action" type="Int32">
        <generator class="sequence">
          <param name="sequence">sg_case_count_action_seq</param>
        </generator>
      </collection-id>
      <key column="key_case_count"/>
      <composite-element class="SurgeryHibernate.Domain.CaseCountAction, SurgeryHibernate">
        <parent name="CaseCount"/>
        <property name="ActionTaken" column="action_taken" type="Boolean"/>
        <many-to-one name="CountAction" class="SurgeryHibernate.Domain.CountAction, SurgeryHibernate" column="key_count_action" outer-join="true"/>
      </composite-element>
    </idbag>
  </class>
</hibernate-mapping>


Thanks,
Tom

_________________
OraclePower.com


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.