From 95e8e5ae304abbd15e0a9d0ac281131c04e0d89e Mon Sep 17 00:00:00 2001 From: sb Date: Wed, 5 Mar 2008 11:05:12 +0000 Subject: [PATCH] More impreovements based on experience with ASL --- transforms01/adl2controllerclasses.xslt | 79 +++++++++++++------------ transforms01/adl2entityclass.xslt | 8 +-- transforms01/adl2views.xslt | 57 +++++++++++------- transforms01/csharp-type-include.xslt | 17 +++++- 4 files changed, 95 insertions(+), 66 deletions(-) diff --git a/transforms01/adl2controllerclasses.xslt b/transforms01/adl2controllerclasses.xslt index 6ce7db8..f5750fb 100755 --- a/transforms01/adl2controllerclasses.xslt +++ b/transforms01/adl2controllerclasses.xslt @@ -9,8 +9,8 @@ Transform ADL into (partial) controller classes $Author: sb $ - $Revision: 1.12 $ - $Date: 2008-03-04 17:30:52 $ + $Revision: 1.13 $ + $Date: 2008-03-05 11:05:12 $ --> + select="substring( '$Revision: 1.13 $', 11)"/> @@ -172,11 +172,30 @@ namespace { else { /* it's existing, retrieve it */ - + + + + + + eid = + hibernator.CreateCriteria( typeof( )) + .Add(Expression.Eq( "", id)) + .UniqueResult<>(); + record = hibernator.CreateCriteria(typeof()) - .Add(Expression.Eq("", id)) + .Add(Expression.Eq("", eid)) .UniqueResult<>(); + + + record = + hibernator.CreateCriteria(typeof()) + .Add(Expression.Eq("", id)) + .UniqueResult<>(); + + + } if ( record != null) @@ -317,7 +336,7 @@ namespace { Session[ NHibernateHelper.USERTOKEN], Session[NHibernateHelper.PASSTOKEN] ); - } + } @@ -673,16 +692,18 @@ namespace { - No entity? + ADL: ERROR: No entity passed to template primary-key-csharp-type - - ADL: ERROR: entity '' has no primary key. + + ADL: WARNING: entity '' has no primary key. + You will have to manually edit + @@ -690,37 +711,21 @@ namespace { - - + + + ADL: WARNING: Entity has a composite primary key. + You will need to manually edit + + - - - - - ADL: WARNING: entity '' has a compound primary key; - adl2controllerclasses is not yet clever enough to generate appropriate code. - - - - - - + + - - - - - - - - - - - - - - + + ADL: WARNING: Entity has no primary key. + You will need to manually edit + diff --git a/transforms01/adl2entityclass.xslt b/transforms01/adl2entityclass.xslt index 5b61ae2..5463254 100755 --- a/transforms01/adl2entityclass.xslt +++ b/transforms01/adl2entityclass.xslt @@ -8,8 +8,8 @@ Transform ADL into entity classes $Author: sb $ - $Revision: 1.9 $ - $Date: 2008-03-03 17:35:28 $ + $Revision: 1.10 $ + $Date: 2008-03-05 11:05:12 $ --> + select="substring( '$Revision: 1.10 $', 11)"/> @@ -301,7 +301,7 @@ - if ( .Count > 0) { + if ( != null && .Count > 0) { bob.AppendFormat("Cannot delete this as it has {0} dependent ; ", .Count); } diff --git a/transforms01/adl2views.xslt b/transforms01/adl2views.xslt index db9abeb..cdc93ea 100755 --- a/transforms01/adl2views.xslt +++ b/transforms01/adl2views.xslt @@ -12,8 +12,8 @@ Transform ADL into velocity view templates $Author: sb $ - $Revision: 1.8 $ - $Date: 2008-03-04 17:30:52 $ + $Revision: 1.9 $ + $Date: 2008-03-05 11:05:12 $ --> @@ -44,7 +44,7 @@ stored to CVS --> + select="substring( '$Revision: 1.9 $', 11)"/> @@ -654,6 +654,7 @@ + $FormHelper.HiddenField( "instance.") @@ -1108,9 +1109,9 @@ - + - Add a new + Add a new @@ -1164,15 +1165,17 @@ #end + #if ( $instance.) $t.Msg( $instance.) + #end - #if( $instance.) - $instance..UserIdentifier - #end + #if( $instance.) + $instance..UserIdentifier + #end - $!instance. + $!instance. @@ -1239,19 +1242,29 @@ #end - - - - #if( $instance.) - $instance..UserIdentifier - #end - - - $!instance. - - - - + + + + #if ( $instance.) + $instance..ToString( 'd') + #end + + + #if ( $instance.) + $t.Msg( $instance.) + #end + + + #if( $instance.) + $instance..UserIdentifier + #end + + + $!instance. + + + + diff --git a/transforms01/csharp-type-include.xslt b/transforms01/csharp-type-include.xslt index 7cb8890..eb44928 100755 --- a/transforms01/csharp-type-include.xslt +++ b/transforms01/csharp-type-include.xslt @@ -10,8 +10,8 @@ one place for ease of maintenance $Author: sb $ - $Revision: 1.4 $ - $Date: 2008-02-27 17:38:42 $ + $Revision: 1.5 $ + $Date: 2008-03-05 11:05:12 $ --> + @@ -36,6 +37,7 @@ + @@ -48,6 +50,7 @@ + @@ -56,6 +59,7 @@ + @@ -79,7 +83,14 @@ double Decimal - + + + + + + + + [unknown?]