Fixed to use NHibernate's ILifecycle callbacks, rather than my own hacked *hook callbacks.
This commit is contained in:
parent
aec6114d9f
commit
74be55668f
|
@ -9,8 +9,8 @@
|
||||||
Transform ADL into (partial) controller classes
|
Transform ADL into (partial) controller classes
|
||||||
|
|
||||||
$Author: sb $
|
$Author: sb $
|
||||||
$Revision: 1.16 $
|
$Revision: 1.17 $
|
||||||
$Date: 2008-03-12 17:40:02 $
|
$Date: 2008-03-19 14:46:20 $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
|
<!-- 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
|
// Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s
|
||||||
// Automatically generated from application description using
|
// 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.
|
// 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
|
// Controller for auto-generated forms for editing <xsl:value-of select="@name"/>s
|
||||||
// Automatically generated from application description using
|
// 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.
|
// 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 */
|
/* again, probably more normal than otherwise */
|
||||||
record = new <xsl:value-of select="concat($entityns, '.', @name)"/>();
|
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");
|
messages.Add( "New <xsl:value-of select="@name"/> record created");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,16 +355,10 @@ namespace <xsl:value-of select="$controllerns"/> {
|
||||||
}
|
}
|
||||||
</xsl:for-each>
|
</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 */
|
/* write the record to the database, in order to guarantee we have a valid key */
|
||||||
hibernator.Save(record);
|
hibernator.Save(record);
|
||||||
hibernator.Flush();
|
hibernator.Flush();
|
||||||
|
|
||||||
/* perform any domain knowledge behaviour on the record after updating */
|
|
||||||
record.AfterUpdateHook( hibernator);
|
|
||||||
|
|
||||||
messages.Add( "Record saved successfully");
|
messages.Add( "Record saved successfully");
|
||||||
}
|
}
|
||||||
catch ( DataSuitabilityException dse)
|
catch ( DataSuitabilityException dse)
|
||||||
|
@ -430,8 +421,6 @@ namespace <xsl:value-of select="$controllerns"/> {
|
||||||
|
|
||||||
if ( record != null)
|
if ( record != null)
|
||||||
{
|
{
|
||||||
record.BeforeDeleteHook( hibernator);
|
|
||||||
|
|
||||||
hibernator.Delete( record);
|
hibernator.Delete( record);
|
||||||
|
|
||||||
hibernator.Flush();
|
hibernator.Flush();
|
||||||
|
|
Loading…
Reference in a new issue