-->
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.  [ 4 posts ] 
Author Message
 Post subject: Interceptor and onFlushDirty losing old values (newbie)
PostPosted: Fri Sep 02, 2005 12:17 pm 
Newbie

Joined: Fri Sep 02, 2005 11:54 am
Posts: 3
Hi, I'm using the Interceptor to catch all CRUD operations on persistent objects. When using onFlushDirty() the oldValues array is empty.
Example code and mapping below:

tvm in advance,
rfee42

onFlushDirty implementation
public boolean onFlushDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState,
String[] propertyNames, Type[] types) throws CallbackException {
s_log.debug("RF in AuditInterceptor, onFlushDirty()");
s_log.debug("Entity: " + entity);
setupServletAndHibernateSessions();
if (servletSession == null) {
s_log.debug("servletSession null in onFlushDirty");
} else {
String previousStateDescription = null;
try {
s_log.debug("RF creating previous state desc");
previousStateDescription = createStateDescription(entity, id, previousState, propertyNames, types);
s_log.debug("RF previousStateDescription = " + previousStateDescription);
} catch (AuditCoreException e) {
s_log.warn("Problem retrieving previous state description for " + entity, e);
previousStateDescription = "";
}
String currentStateDescription = null;
try {
currentStateDescription = createStateDescription(entity, id, currentState, propertyNames, types);
} catch (AuditCoreException e) {
s_log.warn("Problem retrieving current state description for " + entity, e);
currentStateDescription = "";
}
events.add(auditor.audit((User)servletSession.getAttribute(CoreConstants.SESSION_SCRED),
(String)servletSession.getAttribute(CoreConstants.SESSION_IP),
(String)servletSession.getAttribute(CoreConstants.SESSION_WEBSERVER), entity.getClass().getName(),
getEntityId(entity), AuditType.lookup(entity.getClass().getName(), AuditType.OperationType.UPDATE),
previousStateDescription, currentStateDescription));
}
return false;
}

-------------------------------------------------------
private String createStateDescription(Object entity, Serializable id, Object[] state, String[] propertyNames,
Type[] types) throws AuditCoreException {
if(state == null){
s_log.debug("RF CSD state is null");
}else{
s_log.debug("RF CSD stats is not null, state is");
s_log.debug(state.toString());
}
if (state != null) {
s_log.debug("State:" + state.length + " pNames:" + propertyNames.length + " types:" + types.length);
Properties props = new Properties();
SessionFactoryImplementor sessionFactory = (SessionFactoryImplementor)hibernateSession.getSessionFactory();
for (int i = 0; i < state.length; i++) {
try {
String propVal = types[i].toLoggableString(state[i], sessionFactory);
props.setProperty(propertyNames[i], propVal);
s_log.debug("RF CSD pName = " + propertyNames[i] + " pVal = " + propVal);
} catch (PropertyAccessException e) {
throw new AuditCoreException("Could not access property " + propertyNames[i], e);
} catch (HibernateException e1) {
throw new AuditCoreException("Could not access property " + propertyNames[i], e1);
}
}

ByteArrayOutputStream outB = new ByteArrayOutputStream();
try {
props.storeToXML(outB, entity.getClass().getName() + "/" + id);
} catch (IOException e) {
throw new AuditCoreException("Could not create xml");
}
s_log.debug("RF value = " + outB.toString());
return outB.toString();
} else {
return "";
}
}




3.0.5

Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!-- insl.core.data.User root -->
<class name="insl.core.data.User" table="user" select-before-update="true" >
<id name="id" type="int" column="userId" unsaved-value="0">
<generator class="native"/>
</id>
<property name="location" column="location" type="string"/>
<property name="quarAddr" column="quarAddr" type="string"/>
<!-- Clutch because changes to the db structure are too painful -->
<property name="mySQLUser" column="isMySQLUser" type="boolean"/>
<property name="mailServer" column="mailServer" type="string"/>
<property name="admin" column="admin" type="boolean"/>
<property name="adminINSL" column="AdminINSL" type="boolean"/>
<property name="adminSuper" column="adminSuper" type="boolean"/>
<property name="auditor" column="auditor" type="boolean"/>
<property name="developer" column="developer" type="boolean"/>
<property name="emailAddr" column="emailAddr" type="string"/>
<property name="gid" column="gid" type="int"/>
<property name="mailbox" column="mailbox" type="string"/>
<many-to-one name="company" class="insl.core.data.Company" column="companyID"
cascade="none" outer-join="auto" not-null="true" lazy="false" />
<many-to-one name="policy" class="insl.core.data.EmbeddedPolicy" column="policyID"
cascade="all" outer-join="auto" lazy="false"/>
<property name="country" column="country" type="string"/>
<property name="reportAccess" column="reportAccess" type="boolean"/>
<property name="logSearchAccess" column="logSearchAccess" type="boolean"/>
<property name="mobile" column="mobile" type="string"/>
<many-to-one name="domain" class="insl.core.data.OU" column="ouID"
cascade="none" outer-join="auto" lazy="false"/>
<property name="phone" column="phone" type="string"/>
<property name="fullName" column="fullName" type="string"/>
<property name="adminDeletable" column="adminDeletable" type="boolean"/>
<property name="groupName" column="groupName" type="string"/>
<set name="aliases" cascade="all" table="alias" sort="natural" lazy="false" >
<key column="primaryUserID"/>
<element column="emailAddr" type="string"/>
</set>
</class>

<!-- insl.core.data.Alias - only used for querying -->
<class name="insl.core.data.Alias" table="alias" select-before-update="true">
<id name="id" type="int" column="aliasID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="emailAddr" column="emailAddr" type="string"/>
<property name="primaryUserId" column="primaryUserID" type="int"/>
</class>

<!-- insl.core.data.Rule root -->
<class name="insl.core.data.Rule" table="rule" select-before-update="true">
<id name="id" type="int" column="ruleId" unsaved-value="0">
<generator class="native"/>
</id>
<many-to-one name="ou" class="insl.core.data.OU" column="ouId"
cascade="none" outer-join="auto" lazy="false"/>
<many-to-one name="user" class="insl.core.data.User" column="userId"
cascade="none" outer-join="auto" lazy="false"/>
<many-to-one name="group" class="insl.core.data.Group" column="groupId"
cascade="none" outer-join="auto" lazy="false"/>
<many-to-one name="company" class="insl.core.data.Company" column="companyId"
cascade="none" outer-join="auto" not-null="false" lazy="false"/>
<property name="type" column="type" type="int"/>
<property name="value" column="value" type="string"/>
</class>

<!-- insl.core.data.RedList root -->
<class name="insl.core.data.RedList" table="redlist" select-before-update="true">
<id name="id" type="int" column="redListid" unsaved-value="0">
<generator class="native"/>
</id>
<property name="extension" column="extension" type="string"/>
</class>

<!-- insl.core.data.OU root -->
<class name="insl.core.data.OU" table="ou" select-before-update="true">
<id name="id" type="int" column="OUID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="ouName" column="ouName" type="string"/>
<property name="transport" column="transport" type="string"/>
<property name="useMailServer" column="useMailServer" type="boolean"/>
<property name="quarDomain" column="quarDomain" type="string"/>
<property name="description" column="description" type="string"/>
<many-to-one name="company" class="insl.core.data.Company" column="companyID"
cascade="none" outer-join="auto" not-null="true" lazy="false"/>
<property name="checkLDAP" column="checkLDAP" type="boolean"/>
<many-to-one name="policy" class="insl.core.data.EmbeddedPolicy" column="policyID"
cascade="all" outer-join="auto" lazy="false"/>
<many-to-one name="parentNamedPolicy" class="insl.core.data.Policy" column="parentNamedPolicy"
cascade="none" outer-join="auto" lazy="false"/>
<bag name="ouInSvr" table="ouinsvr" cascade="all" lazy="false" >
<key column="OUId"/>
<composite-element class="insl.core.data.OUInSvr">
<property name="id" column="OUInSvrId"/>
<property name="svrName" column="svrName" type="string"/>
<property name="svrWeight" column="svrWeight" type="int"/>
<property name="activated" column="activated" type="int"/>
</composite-element>
</bag>
</class>
<class name="insl.core.data.Group" table="ougroup" select-before-update="true">
<id name="id" type="int" column="groupID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="groupName" column="groupName" type="string"/>
<property name="description" column="description" type="string"/>
<many-to-one name="company" class="insl.core.data.Company" column="companyID"
cascade="none" outer-join="auto" not-null="true" lazy="false"/>
<many-to-one name="policy" class="insl.core.data.EmbeddedPolicy" column="policyID"
cascade="all" outer-join="auto" lazy="false"/>
<many-to-one name="parentNamedPolicy" class="insl.core.data.Policy" column="parentNamedPolicy"
cascade="none" outer-join="auto" lazy="false"/>
</class>
<!-- insl.core.data.OUInSvr root -->
<class name="insl.core.data.OUInSvr" table="ouinsvr" select-before-update="true">
<id name="id" type="int" column="OUInSvrID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="OUId" column="OUID" type="int"/>
<property name="svrName" column="svrName" type="string"/>
<property name="svrWeight" column="svrWeight" type="int"/>
<property name="activated" column="activated" type="int"/>
</class>
<!-- insl.core.data.Disclaimer root -->
<class name="insl.core.data.Disclaimer" table="disclaimer" select-before-update="true">
<id name="id" type="int" column="disclaimerID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="companyId" column="companyId" type="int" not-null="true" />
<property name="disclaimer" column="disclaimer" type="string" not-null="true" />
<property name="discName" column="discName" type="string" not-null="true" />
<property name="description" column="description" type="string" not-null="true" />
<property name="discFormat" column="discFormat" type="int" not-null="true" />
</class>
<!-- insl.core.data.Company root -->
<class name="insl.core.data.Company" table="company" select-before-update="true" >
<id name="id" type="int" column="companyID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="webAdd" column="webAdd" type="string"/>
<property name="coName" column="coName" type="string" not-null="true"/>
<property name="fax" column="fax" type="string"/>
<property name="country" column="country" type="string"/>
<property name="add3" column="add3" type="string"/>
<property name="postcode" column="postcode" type="string"/>
<property name="add2" column="add2" type="string"/>
<property name="add1" column="add1" type="string"/>
<property name="phone" column="phone" type="string"/>
<property name="town" column="town" type="string"/>
<property name="co" column="co" type="string"/>
<many-to-one name="policy" class="insl.core.data.EmbeddedPolicy" column="policyID"
cascade="all" outer-join="auto" lazy="false"/>
<bag name="ouOutSvr" table="ououtsvr" cascade="all" lazy="false">
<key column="companyID"/>
<composite-element class="insl.core.data.OUOutSvr">
<property name="id" column="OUOutSvrId" type="int" />
<property name="svrIP" column="svrIP" type="string"/>
<property name="description" column="description" type="string"/>
<property name="activated" column="activated" type="int"/>
</composite-element>
</bag>
</class>
<!-- insl.core.data.OUOutSvr root -->
<class name="insl.core.data.OUOutSvr" table="ououtsvr" select-before-update="true">
<id name="id" type="int" column="OUOutSvrID" unsaved-value="0" >
<generator class="native"/>
</id>
<property name="companyId" column="companyID" type="int" not-null="true"/>
<property name="svrIP" column="svrIP" type="string"/>
<property name="description" column="description" type="string"/>
<property name="activated" column="activated" type="int" not-null="true"/>
</class>
<!-- insl.core.data.AdminOU root -->
<class name="insl.core.data.AdminOU" table="adminou" select-before-update="true">
<id name="id" type="int" column="adminouid" unsaved-value="0">
<generator class="native"/>
</id>
<many-to-one name="ou" class="insl.core.data.OU" column="ouid"
cascade="none" outer-join="auto" lazy="false" />
<many-to-one name="admin" class="insl.core.data.User" column="userId"
cascade="none" outer-join="auto" lazy="false"/>
</class>

<!-- insl.core.data.AdminOU root -->
<class name="insl.core.data.AdminGroup" table="admingroup" select-before-update="true">
<id name="id" type="int" column="adminGroupId" unsaved-value="0">
<generator class="native"/>
</id>
<many-to-one name="group" class="insl.core.data.Group" column="groupId"
cascade="none" outer-join="auto" lazy="false"/>
<many-to-one name="admin" class="insl.core.data.User" column="userId"
cascade="none" outer-join="auto" lazy="false"/>
</class>

<class name="insl.core.data.Policy" table="policy" select-before-update="true">
<id name="id" type="int" column="policyID" unsaved-value="0">
<generator class="native"/>
</id>
<discriminator column="policyType" type="boolean"/>
<many-to-one name="filterAttachment" class="insl.core.data.FilterAttachment" column="attachmentID"
cascade="all" outer-join="auto" lazy="false"/>
<many-to-one name="filterGeneral" class="insl.core.data.FilterGeneral" column="generalID"
cascade="all" outer-join="auto" lazy="false"/>
<many-to-one name="filterURL" class="insl.core.data.FilterURL" column="urlID"
cascade="all" outer-join="auto" lazy="false"/>
<many-to-one name="filterImage" class="insl.core.data.FilterImage" column="imageID"
cascade="all" outer-join="auto" lazy="false"/>
<list name="filterSpam" cascade="all-delete-orphan" inverse="true" lazy="false">
<key column="policyID"/>
<index column="genType"/>
<one-to-many class="insl.core.data.FilterSpam"/>
</list>
<list name="filterVirus" cascade="all-delete-orphan" inverse="true" lazy="false">
<key column="policyID"/>
<index column="genType"/>
<one-to-many class="insl.core.data.FilterVirus"/>
</list>
<many-to-one name="filterSpoofing" class="insl.core.data.FilterSpoofing" column="spoofID"
cascade="all" outer-join="auto" lazy="false"/>
<subclass name="insl.core.data.EmbeddedPolicy" discriminator-value="false" select-before-update="true" />
<subclass name="insl.core.data.NamedPolicy" discriminator-value="true" select-before-update="true" >
<property name="name" column="name" type="string"/>
<property name="description" column="description" type="string"/>
<many-to-one name="company" class="insl.core.data.Company" column="companyID"
cascade="none" outer-join="auto" lazy="false"/>
</subclass>
</class>
<class name="insl.core.data.FilterAttachment" table="filterattachment" select-before-update="true">
<id name="id" type="int" column="filterID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="genRestrict" column="genRestrict" type="byte"/>
<property name="inPwdZipFileAction" column="inPwdZipFileAction" type="byte"/>
<property name="inRestrict" column="inRestrict" type="byte"/>
<property name="inActivated" column="inActivated" type="byte"/>
<property name="inAction" column="inAction" type="byte"/>
<property name="inInformAdmin" column="inInformAdmin" type="boolean"/>
<property name="inInformRecipient" column="inInformRecipient" type="boolean"/>
<property name="inRedListActivated" column="inRedListActivated" type="boolean"/>
<property name="inZipActivated" column="inZipActivated" type="boolean"/>
<property name="inContentActivated" column="inContentActivated" type="boolean"/>
<property name="inRedirect" column="inRedirect" type="string"/>
<property name="outRestrict" column="outRestrict" type="byte"/>
<property name="outActivated" column="outActivated" type="byte"/>
<property name="outAction" column="outAction" type="byte"/>
<property name="outPwdZipFileAction" column="outPwdZipFileAction" type="byte"/>
<property name="outZipActivated" column="outZipActivated" type="boolean"/>
<property name="outContentActivated" column="outContentActivated" type="boolean"/>
<property name="outInformAdmin" column="outInformAdmin" type="boolean"/>
<property name="outInformSender" column="outInformSender" type="boolean"/>
<property name="outRedListActivated" column="outRedListActivated" type="boolean"/>
<property name="outRedirect" column="outRedirect" type="string"/>
<property name="activated" column="activated" type="byte"/>
<bag name="blockList" table="attachment" cascade="all" where="(type=0 or type=2 or type=4)" lazy="false">
<key column="filterID"/>
<composite-element class="insl.core.data.Attachment">
<property name="extension" column="extension" type="string"/>
<property name="type" column="type" type="int"/>
</composite-element>
</bag>
<bag name="allowedRedList" table="attachment" cascade="all" where="type=1" lazy="false" >
<key column="filterID"/>
<composite-element class="insl.core.data.Attachment">
<property name="extension" column="extension" type="string"/>
<property name="type" column="type" type="int"/>
</composite-element>
</bag>
</class>
<class name="insl.core.data.FilterGeneral" table="filtergeneral" select-before-update="true">
<id name="id" type="int" column="filterID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="genRestrict" column="genRestrict" type="byte" />
<property name="genViewQuarantineBody" column="genViewQuarantineBody" type="boolean"/>
<property name="inRestrict" column="inRestrict" type="byte"/>
<property name="inMaxMsgSize" column="inMaxMsgSize" type="int"/>
<property name="inUnknownUsers" column="inUnknownUsers" type="byte"/>
<property name="inUnknownUsersAddr" column="inUnknownUsersAddr" type="string"/>
<property name="inInformAdmin" column="inInformAdmin" type="boolean"/>
<property name="inInformRecipient" column="inInformRecipient" type="boolean"/>
<property name="inSuspiciousCharacterAction" column="inSuspiciousCharacterAction" type="byte"/>
<property name="inCobionFeedback" column="inCobionFeedback" type="boolean"/>
<property name="inInsertFeedbackURL" column="inInsertFeedbackURL" type="boolean"/>
<property name="inDefaultAction" column="inDefaultAction" type="byte"/>
<property name="inDefaultActionAddrType" column="inDefaultActionAddrType" type="byte"/>
<property name="inDefaultActionAddrUsername" column="inDefaultActionAddrUsername" type="string"/>
<property name="inDefaultActionAddrDomain" column="inDefaultActionAddrDomain" type="string"/>
<property name="inDefaultActionCopy" column="inDefaultActionCopy" type="boolean"/>
<property name="inDefaultActionCopyAddr" column="inDefaultActionCopyAddr" type="string"/>
<property name="outRestrict" column="outRestrict" type="byte"/>
<property name="outInformAdmin" column="outInformAdmin" type="boolean"/>
<property name="outInformSender" column="outInformSender" type="boolean"/>
<property name="outMaxMsgSize" column="outMaxMsgSize" type="int"/>
<property name="outSuspiciousCharacterAction" column="outSuspiciousCharacterAction" type="byte"/>
<property name="outDisclaimerId" column="outDisclaimerID" type="int"/>
<property name="outDefaultAction" column="outDefaultAction" type="byte"/>
<property name="outDefaultActionAddrType" column="outDefaultActionAddrType" type="byte"/>
<property name="outDefaultActionAddrUsername" column="outDefaultActionAddrUsername" type="string"/>
<property name="outDefaultActionAddrDomain" column="outDefaultActionAddrDomain" type="string"/>
<property name="outDefaultActionCopy" column="outDefaultActionCopy" type="boolean"/>
<property name="outDefaultActionCopyAddr" column="outDefaultActionCopyAddr" type="string"/>
<property name="outDefaultActionRewriteFrom" column="outDefaultActionRewriteFrom" type="boolean"/>
<property name="activated" column="activated" type="byte"/>
</class>
<class name="insl.core.data.FilterImage" table="filterimage" select-before-update="true">
<id name="id" type="int" column="filterID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="inAction" column="inAction" type="byte"/>
<property name="inRestrict" column="inRestrict" type="byte"/>
<property name="inActivated" column="inActivated" type="byte"/>
<property name="inRedirect" column="inRedirect" type="string"/>
<property name="inInformRecipient" column="inInformRecipient" type="boolean"/>
<property name="inInformAdmin" column="inInformAdmin" type="boolean"/>
<property name="inTag" column="inTag" type="string"/>
<property name="inTagCopy" column="inTagCopy" type="string"/>
<property name="inTagCopyActivated" column="inTagCopyActivated" type="boolean"/>
<property name="inThreshold" column="inThreshold" type="int"/>
<property name="outRestrict" column="outRestrict" type="byte"/>
<property name="outAction" column="outAction" type="byte"/>
<property name="outActivated" column="outActivated" type="byte"/>
<property name="outRedirect" column="outRedirect" type="string"/>
<property name="outInformSender" column="outInformSender" type="boolean"/>
<property name="outInformAdmin" column="outInformAdmin" type="boolean"/>
<property name="outThreshold" column="outThreshold" type="int"/>
<property name="activated" column="activated" type="byte"/>
</class>
<class name="insl.core.data.FilterURL" table="filterurl" select-before-update="true">
<id name="id" type="int" column="filterID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="inAction" column="inAction" type="byte"/>
<property name="inRedirect" column="inRedirect" type="string"/>
<property name="inRestrict" column="inRestrict" type="byte"/>
<property name="inActivated" column="inActivated" type="byte"/>
<property name="inFilterMask" column="inFilterMask" type="binary"/>
<property name="inInformRecipient" column="inInformRecipient" type="boolean"/>
<property name="inInformAdmin" column="inInformAdmin" type="boolean"/>
<property name="inTag" column="inTag" type="string"/>
<property name="inTagAction" column="inTagAction" type="byte"/>
<property name="outAction" column="outAction" type="byte"/>
<property name="outRedirect" column="outRedirect" type="string"/>
<property name="outRestrict" column="outRestrict" type="byte"/>
<property name="outActivated" column="outActivated" type="byte"/>
<property name="outFilterMask" column="outFilterMask" type="binary"/>
<property name="outInformSender" column="outInformSender" type="boolean"/>
<property name="outInformAdmin" column="outInformAdmin" type="boolean"/>
<property name="activated" column="activated" type="byte"/>
</class>
<class name="insl.core.data.FilterSpam" table="filterspam" select-before-update="true">
<id name="id" type="int" column="filterID" unsaved-value="0">
<generator class="native"/>
</id>
<many-to-one name="policy" column="PolicyID" lazy="false"/>
<property name="genType" column="genType" type="byte"/>
<property name="inRestrict" column="inRestrict" type="byte"/>
<property name="inActivated" column="inActivated" type="byte"/>
<property name="inThreshold1" column="inThreshold1" type="double"/>
<property name="inThreshold2" column="inThreshold2" type="double"/>
<property name="inThreshold3" column="inThreshold3" type="double"/>
<property name="inInformAdmin2" column="inInformAdmin2" type="boolean"/>
<property name="inInformAdmin3" column="inInformAdmin3" type="boolean"/>
<property name="inTag" column="inTag" type="string"/>
<property name="inTagAction" column="inTagAction" type="byte"/>
<property name="outRestrict" column="outRestrict" type="byte"/>
<property name="outActivated" column="outActivated" type="byte"/>
<property name="outThreshold1" column="outThreshold1" type="double"/>
<property name="outThreshold2" column="outThreshold2" type="double"/>
<property name="outThreshold3" column="outThreshold3" type="double"/>
<property name="outInformAdmin2" column="outInformAdmin2" type="boolean"/>
<property name="outInformAdmin3" column="outInformAdmin3" type="boolean"/>
<property name="activated" column="activated" type="byte"/>
</class>
<class name="insl.core.data.FilterVirus" table="filtervirus" select-before-update="true">
<id name="id" type="int" column="filterID" unsaved-value="0">
<generator class="native"/>
</id>
<many-to-one name="policy" column="PolicyID" lazy="false"/>
<property name="genType" column="genType" type="byte"/>
<property name="inAction" column="inAction" type="byte"/>
<property name="inRestrict" column="inRestrict" type="byte"/>
<property name="inActivated" column="inActivated" type="byte"/>
<property name="inRedirect" column="inRedirect" type="string"/>
<property name="inInformRecipient" column="inInformRecipient" type="boolean"/>
<property name="inInformAdmin" column="inInformAdmin" type="boolean"/>
<property name="inScanErrorAction" column="inScanErrorAction" type="byte"/>
<property name="outAction" column="outAction" type="byte"/>
<property name="outRestrict" column="outRestrict" type="byte"/>
<property name="outActivated" column="outActivated" type="byte"/>
<property name="outRedirect" column="outRedirect" type="string"/>
<property name="outInformSender" column="outInformSender" type="boolean"/>
<property name="outInformAdmin" column="outInformAdmin" type="boolean"/>
<property name="activated" column="activated" type="byte"/>
</class>
<!-- insl.core.data.FilterSpoofing -->
<class name="insl.core.data.FilterSpoofing" table="filterspoofing" select-before-update="true">
<id name="id" type="int" column="filterID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="inRestrict" column="inRestrict" type="byte"/>
<property name="inActivated" column="inActivated" type="byte"/>
<property name="inAction" column="inAction" type="byte"/>
<property name="inInformAdmin" column="inInformAdmin" type="boolean"/>
<property name="inInformRecipient" column="inInformRecipient" type="boolean"/>
<property name="inRedirect" column="inRedirect" type="string"/>
<property name="outRestrict" column="outRestrict" type="byte"/>
<property name="outActivated" column="outActivated" type="byte"/>
<property name="activated" column="activated" type="byte"/>
<bag name="allowed" table="allowedspoofing" cascade="all" lazy="false" >
<key column="filterID"/>
<composite-element class="insl.core.data.AllowedSpoofing">
<property name="id" column="allowedspoofingID"/>
<property name="type" column="type" type="int"/>
<property name="value" column="value" type="string"/>
</composite-element>
</bag>
</class>
<!-- insl.core.data.AllowedSpoofing -->
<class name="insl.core.data.AllowedSpoofing" table="allowedspoofing" select-before-update="true">
<id name="id" type="int" column="allowedspoofingID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="filterId" column="filterID" type="int"/>
<property name="type" column="type" type="int"/>
<property name="value" column="value" type="string"/>
</class>

<!-- insl.core.data.Period root -->
<class name="insl.core.data.Period" table="period" select-before-update="true">
<id name="id" type="int" column="periodID" unsaved-value="0">
<generator class="native"/>
</id>
<property name="type" column="type" type="int"/>
<property name="value" column="value" type="int"/>
<many-to-one name="ou" class="insl.core.data.OU" column="ouid"
cascade="none" outer-join="auto" lazy="false"/>
<many-to-one name="group" class="insl.core.data.Group" column="groupId"
cascade="none" outer-join="auto" lazy="false"/>
<many-to-one name="user" class="insl.core.data.User" column="userId"
cascade="none" outer-join="auto" lazy="false"/>
</class>


<class name="insl.core.data.Image" table="images" select-before-update="true">
<id name="id" type="int" column="imageId" unsaved-value="0">
<generator class="native"/>
</id>
<property name="image" column="image" type="binary"/>
</class>

</hibernate-mapping>



Code between sessionFactory.openSession() and session.close():
Lots and distributed

Full stack trace of any exception that occurs:
No Exception

Name and version of the database you are using:
MySQL V4.1

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 9:05 pm 
Newbie

Joined: Tue May 24, 2005 7:08 pm
Posts: 17
Location: Melbourne
Sorry not to address your code directly but I just updated my entry in the wiki that shows you how to perform Audit logging and overcomes your problem...

http://www.hibernate.org/318.html

I haven't included all code related to this in here but it should give you an idea of my approach at least. If you need further info on how to get this going let me know.


Top
 Profile  
 
 Post subject: Different route
PostPosted: Wed Sep 14, 2005 3:57 am 
Newbie

Joined: Fri Sep 02, 2005 11:54 am
Posts: 3
Rmonie - thanks for your help.


But 'the business' has decided to take a slightly more old fashioned approach. What we're going to do now is put an extra piece of logging code in all our DAOs and code it manually rather than use the interceptor.

Old fashioned, I know, and not as elegant as an Interceptor but 'the business' has had its' fingers burnt and wants a more tried and trusted method.

Eventually I'll get around to implementing the Interceptor and maybe talk to you again about it?


Ta,
Rob Fee


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 14, 2005 4:03 am 
Newbie

Joined: Tue May 24, 2005 7:08 pm
Posts: 17
Location: Melbourne
Ahhhh... You've gotta love 'the business' don't you ;) Getting involved where they really have no business.

Depending on what it is you're logging I think you'll find this a much more difficult approach but if you get something generic working from the DAOs i'd be interested in seeing your approach.

cheers,

rob


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.