|
From: Peter S. <sz...@us...> - 2004-04-06 11:04:35
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18516/NHibernate/Tool/hbm2net Modified Files: ClassMapping.cs FieldProperty.cs convert.vm Log Message: Made another fix in incrementgenerator. Made a few fixes in hbm2net. Added new abcproxytest, and ignored it because of proxy problems. Index: convert.vm =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2net/convert.vm,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** convert.vm 5 Apr 2004 10:09:59 -0000 1.5 --- convert.vm 6 Apr 2004 10:51:41 -0000 1.6 *************** *** 9,12 **** --- 9,13 ---- //------------------------------------------------------------------------------ + using System; ${classimports} ${javaTool.getPackageDeclaration($clazz)} *************** *** 35,39 **** /// Holder for $field.fieldName /// </summary> ! $field.FieldScope() $field.FullyQualifiedTypeName $field.fieldName; #end --- 36,40 ---- /// Holder for $field.fieldName /// </summary> ! $field.FieldScope() $field.FullyQualifiedTypeName $field.fieldcase; #end *************** *** 62,66 **** { #foreach($field in $clazz.LocalFieldsForFullConstructor()) ! this.$field.fieldName = $field.fieldName; #end } --- 63,67 ---- { #foreach($field in $clazz.LocalFieldsForFullConstructor()) ! this.$field.fieldcase = $field.fieldName; #end } *************** *** 79,83 **** { #foreach($field in $clazz.LocalFieldsForMinimalConstructor()) ! this.$field.fieldName = $field.fieldName; #end } --- 80,84 ---- { #foreach($field in $clazz.LocalFieldsForMinimalConstructor()) ! this.$field.fieldcase = $field.fieldName; #end } *************** *** 96,108 **** /// </summary> #end ! $field.PropertyGetScope() $field.FullyQualifiedTypeName $field.fieldName { get { ! return this.$field.fieldName; } set { ! this.$field.fieldName = value; } } --- 97,109 ---- /// </summary> #end ! $field.PropertyGetScope() $field.FullyQualifiedTypeName $field.propcase { get { ! return this.$field.fieldcase; } set { ! this.$field.fieldcase = value; } } *************** *** 122,126 **** /// </summary> #end ! $field.PropertyGetScope() $field.FullyQualifiedTypeName $field.fieldName { get; --- 123,127 ---- /// </summary> #end ! $field.PropertyGetScope() $field.FullyQualifiedTypeName $field.propcase { get; Index: FieldProperty.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2net/FieldProperty.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FieldProperty.cs 2 Apr 2004 11:40:25 -0000 1.6 --- FieldProperty.cs 6 Apr 2004 10:51:41 -0000 1.7 *************** *** 9,12 **** --- 9,30 ---- public class FieldProperty:MappingElement { + private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + + public string fieldcase + { + get + { + if (fieldName.Substring(0,1) == fieldName.Substring(0,1).ToLower()) + return "_" + fieldName; + return fieldName.Substring(0,1).ToLower() + fieldName.Substring(1); + } + } + public string propcase + { + get + { + return fieldName; + } + } virtual public System.String FieldName { *************** *** 227,230 **** --- 245,250 ---- this.foreignKeys = foreignKeys; MetaAttribs = metaattribs; + if (fieldName.Substring(0,1) == fieldName.Substring(0,1).ToLower()) + log.Warn("Nonstandard naming convention found on " + fieldName); } Index: ClassMapping.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Tool/hbm2net/ClassMapping.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ClassMapping.cs 5 Apr 2004 10:09:47 -0000 1.9 --- ClassMapping.cs 6 Apr 2004 10:51:41 -0000 1.10 *************** *** 425,429 **** --- 425,433 ---- XmlAttribute att = classElement.Attributes["proxy"]; if (att != null) + { proxyClass = att.Value; + if (proxyClass.IndexOf(",")>0) + proxyClass = proxyClass.Substring(0, proxyClass.IndexOf(",")); + } Element id = classElement["id"]; |