Fixed to use NHibernate's ILifecycle callbacks, rather than my own hacked *hook callbacks.

This commit is contained in:
sb 2008-03-19 14:46:20 +00:00
parent aec6114d9f
commit 74be55668f

View file

@ -9,8 +9,8 @@
Transform ADL into (partial) controller classes
$Author: sb $
$Revision: 1.16 $
$Date: 2008-03-12 17:40:02 $
$Revision: 1.17 $
$Date: 2008-03-19 14:46:20 $
-->
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
@ -64,7 +64,7 @@
//
// Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s
// Automatically generated from application description using
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.16 $', 10)"/>
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.17 $', 10)"/>
//
// This file is automatically generated; DO NOT EDIT IT.
//
@ -121,7 +121,7 @@ namespace <xsl:value-of select="$controllerns"/> {
//
// Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s
// Automatically generated from application description using
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.16 $', 10)"/>
// adl2controllerclasses.xslt version <xsl:value-of select="substring( '$Revision: 1.17 $', 10)"/>
//
// This file is automatically generated; DO NOT EDIT IT.
//
@ -225,9 +225,6 @@ namespace <xsl:value-of select="$controllerns"/> {
/* again, probably more normal than otherwise */
record = new <xsl:value-of select="concat($entityns, '.', @name)"/>();
}
/* perform any domain knowledge behaviour on the new record
* after instantiation */
record.AfterCreationHook( hibernator);
messages.Add( "New <xsl:value-of select="@name"/> record created");
}
@ -358,15 +355,9 @@ namespace <xsl:value-of select="$controllerns"/> {
}
</xsl:for-each>
/* perform any domain knowledge behaviour on the record prior to updating */
record.BeforeUpdateHook( hibernator);
/* write the record to the database, in order to guarantee we have a valid key */
hibernator.Save(record);
hibernator.Flush();
/* perform any domain knowledge behaviour on the record after updating */
record.AfterUpdateHook( hibernator);
messages.Add( "Record saved successfully");
}
@ -430,8 +421,6 @@ namespace <xsl:value-of select="$controllerns"/> {
if ( record != null)
{
record.BeforeDeleteHook( hibernator);
hibernator.Delete( record);
hibernator.Flush();