Update of /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5548/NHibernateContrib/src/NHibernate.Tool.hbm2net Modified Files: AbstractRenderer.cs AssemblyInfo.cs BasicRenderer.cs ClassMapping.cs ClassName.cs CodeGenerator.cs DOMRenderer.cs FieldProperty.cs FinderRenderer.cs Generator.cs JavaTool.cs MappingElement.cs MetaAttributeHelper.cs MethodSignatureBuilder.cs NHibernate.Tool.hbm2net-1.1.csproj QueryBuilder.cs Renderer.cs StringResourceLoader.cs SupportClass.cs VelocityRenderer.cs Added Files: SubclassMapping.cs Log Message: Various refactorings on the way to 2.1 querying capability Index: Renderer.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/Renderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Renderer.cs 30 Dec 2004 16:54:54 -0000 1.1 --- Renderer.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 24,28 **** /// @throws Exception /// </param> ! void render(String savedToPackage, String savedToClass, ClassMapping classMapping, IDictionary class2classmap, StreamWriter writer); /// <summary> Called by the generator to determine the package name of the rendered class. --- 24,28 ---- /// @throws Exception /// </param> ! void render(string savedToPackage, string savedToClass, ClassMapping classMapping, IDictionary class2classmap, StreamWriter writer); /// <summary> Called by the generator to determine the package name of the rendered class. *************** *** 33,37 **** /// <returns> the package name the class should be saved to /// </returns> ! String getSaveToPackage(ClassMapping classMapping); /// <summary> Called by the generator to determine the class name of the rendered class. --- 33,37 ---- /// <returns> the package name the class should be saved to /// </returns> ! string getSaveToPackage(ClassMapping classMapping); /// <summary> Called by the generator to determine the class name of the rendered class. *************** *** 42,46 **** /// <returns> the class name the class should be saved to /// </returns> ! String getSaveToClassName(ClassMapping classMapping); } } \ No newline at end of file --- 42,46 ---- /// <returns> the class name the class should be saved to /// </returns> ! string getSaveToClassName(ClassMapping classMapping); } } \ No newline at end of file Index: MetaAttributeHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/MetaAttributeHelper.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MetaAttributeHelper.cs 30 Dec 2004 16:54:54 -0000 1.1 --- MetaAttributeHelper.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 21,28 **** internal class MetaAttribute { ! internal String value_Renamed; internal bool inheritable = true; ! internal MetaAttribute(String value_Renamed, bool inherit) { this.value_Renamed = value_Renamed; --- 21,28 ---- internal class MetaAttribute { ! internal string value_Renamed; internal bool inheritable = true; ! internal MetaAttribute(string value_Renamed, bool inherit) { this.value_Renamed = value_Renamed; *************** *** 30,34 **** } ! public override String ToString() { return value_Renamed; --- 30,34 ---- } ! public override string ToString() { return value_Renamed; *************** *** 46,50 **** SupportClass.ListCollectionSupport metaAttributeList = new SupportClass.ListCollectionSupport(); metaAttributeList.AddAll(element.SelectNodes("meta", CodeGenerator.nsmgr)); ! metaAttributeList.AddAll(element.SelectNodes("urn:meta", CodeGenerator.nsmgr)); for (IEnumerator iter = metaAttributeList.GetEnumerator(); iter.MoveNext(); ) --- 46,50 ---- SupportClass.ListCollectionSupport metaAttributeList = new SupportClass.ListCollectionSupport(); metaAttributeList.AddAll(element.SelectNodes("meta", CodeGenerator.nsmgr)); ! metaAttributeList.AddAll(element.SelectNodes("meta", CodeGenerator.nsmgr)); for (IEnumerator iter = metaAttributeList.GetEnumerator(); iter.MoveNext(); ) *************** *** 52,58 **** Element metaAttrib = (Element) iter.Current; // does not use getTextNormalize() or getTextTrim() as that would remove the formatting in new lines in items like description for javadocs. ! String attribute = (metaAttrib.Attributes["attribute"] == null?string.Empty:metaAttrib.Attributes["attribute"].Value); ! String value_Renamed = metaAttrib.InnerText; ! String inheritStr = (metaAttrib.Attributes["inherit"] == null?null:metaAttrib.Attributes["inherit"].Value); bool inherit = true; if ((Object) inheritStr != null) --- 52,58 ---- Element metaAttrib = (Element) iter.Current; // does not use getTextNormalize() or getTextTrim() as that would remove the formatting in new lines in items like description for javadocs. ! string attribute = (metaAttrib.Attributes["attribute"] == null?string.Empty:metaAttrib.Attributes["attribute"].Value); ! string value_Renamed = metaAttrib.InnerText; ! string inheritStr = (metaAttrib.Attributes["inherit"] == null?null:metaAttrib.Attributes["inherit"].Value); bool inherit = true; if ((Object) inheritStr != null) *************** *** 90,94 **** for (IEnumerator iter = new SupportClass.SetSupport(inherited.Keys).GetEnumerator(); iter.MoveNext(); ) { ! String key = (String) iter.Current; if (!local.ContainsKey(key)) --- 90,94 ---- for (IEnumerator iter = new SupportClass.SetSupport(inherited.Keys).GetEnumerator(); iter.MoveNext(); ) { ! string key = (String) iter.Current; if (!local.ContainsKey(key)) *************** *** 121,125 **** } ! public static String getMetaAsString(SupportClass.ListCollectionSupport meta, String seperator) { StringBuilder buf = new StringBuilder(); --- 121,125 ---- } ! public static string getMetaAsString(SupportClass.ListCollectionSupport meta, string seperator) { StringBuilder buf = new StringBuilder(); *************** *** 155,159 **** } ! internal static String getMetaAsString(SupportClass.ListCollectionSupport c) { if (c == null || c.IsEmpty()) --- 155,159 ---- } ! internal static string getMetaAsString(SupportClass.ListCollectionSupport c) { if (c == null || c.IsEmpty()) Index: FinderRenderer.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/FinderRenderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FinderRenderer.cs 30 Dec 2004 16:54:54 -0000 1.1 --- FinderRenderer.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 133,140 **** } ! private const String MT_FINDERMETHOD = "finder-method"; ! private const String MT_FOREIGNFINDERMETHOD = "foreign-finder-name"; ! private const String MT_FOREIGNFINDERFIELD = "foreign-finder-field"; ! private const String MT_FOREIGNJOINFIELD = "foreign-join-field"; --- 133,140 ---- } ! private const string MT_FINDERMETHOD = "finder-method"; ! private const string MT_FOREIGNFINDERMETHOD = "foreign-finder-name"; ! private const string MT_FOREIGNFINDERFIELD = "foreign-finder-field"; ! private const string MT_FOREIGNJOINFIELD = "foreign-join-field"; *************** *** 144,148 **** /// <exception cref=""> Exception /// </exception> ! public override void render(String savedToPackage, String savedToClass, ClassMapping classMapping, IDictionary class2classmap, StreamWriter mainwriter) { --- 144,148 ---- /// <exception cref=""> Exception /// </exception> ! public override void render(string savedToPackage, string savedToClass, ClassMapping classMapping, IDictionary class2classmap, StreamWriter mainwriter) { *************** *** 156,160 **** writer.WriteLine("/** Automatically generated Finder class for " + savedToClass + ".\n" + " * @author Hibernate FinderGenerator " + " **/"); ! String classScope = "public"; writer.Write(classScope + " class " + savedToClass); --- 156,160 ---- writer.WriteLine("/** Automatically generated Finder class for " + savedToClass + ".\n" + " * @author Hibernate FinderGenerator " + " **/"); ! string classScope = "public"; writer.Write(classScope + " class " + savedToClass); *************** *** 188,192 **** { // Find out of there is a system wide way to get sessions defined ! String sessionMethod = classMapping.getMetaAsString("session-method").Trim(); // fields --- 188,192 ---- { // Find out of there is a system wide way to get sessions defined ! string sessionMethod = classMapping.getMetaAsString("session-method").Trim(); // fields *************** *** 200,204 **** { ! String finderName = field.getMetaAsString(MT_FINDERMETHOD); if ("".Equals(sessionMethod)) --- 200,204 ---- { ! string finderName = field.getMetaAsString(MT_FINDERMETHOD); if ("".Equals(sessionMethod)) *************** *** 221,227 **** else if (field.getMeta(MT_FOREIGNFINDERMETHOD) != null) { ! String finderName = field.getMetaAsString(MT_FOREIGNFINDERMETHOD); ! String fieldName = field.getMetaAsString(MT_FOREIGNFINDERFIELD); ! String joinFieldName = field.getMetaAsString(MT_FOREIGNJOINFIELD); // Build the query --- 221,227 ---- else if (field.getMeta(MT_FOREIGNFINDERMETHOD) != null) { ! string finderName = field.getMetaAsString(MT_FOREIGNFINDERMETHOD); ! string fieldName = field.getMetaAsString(MT_FOREIGNFINDERFIELD); ! string joinFieldName = field.getMetaAsString(MT_FOREIGNJOINFIELD); // Build the query *************** *** 353,357 **** /// <returns> /// </returns> ! public static String getFieldAsObject(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; --- 353,357 ---- /// <returns> /// </returns> ! public static string getFieldAsObject(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; *************** *** 359,363 **** { //UPGRADE_TODO: Method 'java.util.Map.get' was converted to 'System.Collections.IDictionary.Item' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilMapget_javalangObject"' ! String typeName = (String) primitiveToObject[type.Name]; typeName = "new " + typeName + "( "; typeName += (prependThis?"this.":""); --- 359,363 ---- { //UPGRADE_TODO: Method 'java.util.Map.get' was converted to 'System.Collections.IDictionary.Item' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilMapget_javalangObject"' ! string typeName = (String) primitiveToObject[type.Name]; typeName = "new " + typeName + "( "; typeName += (prependThis?"this.":""); *************** *** 381,390 **** /// <returns> /// </returns> ! public static String getFieldAsHibernateType(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; //UPGRADE_TODO: Method 'java.util.Map.get' was converted to 'System.Collections.IDictionary.Item' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilMapget_javalangObject"' ! String hibTypeString = (String) hibType[type.Name]; ! if ((Object) hibTypeString != null) { return hibTypeString; --- 381,390 ---- /// <returns> /// </returns> ! public static string getFieldAsHibernateType(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; //UPGRADE_TODO: Method 'java.util.Map.get' was converted to 'System.Collections.IDictionary.Item' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilMapget_javalangObject"' ! string hibTypeString = (String) hibType[type.Name]; ! if ((object) hibTypeString != null) { return hibTypeString; Index: ClassName.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/ClassName.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassName.cs 30 Dec 2004 16:54:54 -0000 1.1 --- ClassName.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 15,19 **** public class ClassName { ! virtual public String FullyQualifiedName { get --- 15,19 ---- public class ClassName { ! virtual public string FullyQualifiedName { get *************** *** 27,31 **** /// java.util.Set -> "Set" /// </summary> ! virtual public String Name { get --- 27,31 ---- /// java.util.Set -> "Set" /// </summary> ! virtual public string Name { get *************** *** 41,45 **** /// <returns> /// </returns> ! virtual public String PackageName { get --- 41,45 ---- /// <returns> /// </returns> ! virtual public string PackageName { get *************** *** 65,69 **** get { ! String baseTypeName = StringHelper.Replace(fullyQualifiedName, "[]", ""); return PRIMITIVES.Contains(baseTypeName); } --- 65,69 ---- get { ! string baseTypeName = StringHelper.Replace(fullyQualifiedName, "[]", ""); return PRIMITIVES.Contains(baseTypeName); } *************** *** 73,84 **** internal static readonly SupportClass.SetSupport PRIMITIVES = new SupportClass.HashSetSupport(); ! public ClassName(String fqn) { initFullyQualifiedName(fqn); } ! private String fullyQualifiedName = null; ! private String name = null; ! private String packageName = null; /// <summary>Two ClassName are equals if their fullyQualifiedName are the same/equals! </summary> --- 73,84 ---- internal static readonly SupportClass.SetSupport PRIMITIVES = new SupportClass.HashSetSupport(); ! public ClassName(string fqn) { initFullyQualifiedName(fqn); } ! private string fullyQualifiedName = null; ! private string name = null; ! private string packageName = null; /// <summary>Two ClassName are equals if their fullyQualifiedName are the same/equals! </summary> *************** *** 101,105 **** public virtual bool inSamePackage(ClassName other) { ! return (Object) other.packageName == (Object) this.packageName || ((Object) other.packageName != null && other.packageName.Equals(this.packageName)); } --- 101,105 ---- public virtual bool inSamePackage(ClassName other) { ! return (object) other.packageName == (Object) this.packageName || ((Object) other.packageName != null && other.packageName.Equals(this.packageName)); } *************** *** 108,112 **** * Initialize the class fields with info from a fully qualified name. */ ! private void initFullyQualifiedName(String fqn) { this.fullyQualifiedName = fqn; --- 108,112 ---- * Initialize the class fields with info from a fully qualified name. */ ! private void initFullyQualifiedName(string fqn) { this.fullyQualifiedName = fqn; *************** *** 117,122 **** if ((Object) fqn != null) { ! ! int lastDot = fqn.LastIndexOf(","); if (lastDot < 0) { --- 117,121 ---- if ((Object) fqn != null) { ! int lastDot = fqn.LastIndexOf("."); if (lastDot < 0) { *************** *** 126,132 **** else { ! packageName = fqn.Substring(0, (lastDot) - (0)); ! name = packageName.Substring(packageName.LastIndexOf(".") + 1); ! packageName = packageName.Substring(0, (packageName.LastIndexOf(".")) - (0)); } } --- 125,130 ---- else { ! name = fqn.Substring( lastDot + 1 ); ! packageName = fqn.Substring(0, lastDot); } } *************** *** 144,148 **** } ! public override String ToString() { return FullyQualifiedName; --- 142,146 ---- } ! public override string ToString() { return FullyQualifiedName; Index: CodeGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/CodeGenerator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CodeGenerator.cs 30 Dec 2004 16:54:54 -0000 1.1 --- CodeGenerator.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 22,25 **** --- 22,28 ---- internal static XmlNamespaceManager nsmgr; + private static ArrayList children; + private static MultiMap allMaps; + [STAThread] public static void Main(String[] args) *************** *** 28,31 **** --- 31,37 ---- nsmgr.AddNamespace("urn", "urn:nhibernate-mapping-2.0"); + children = new ArrayList(); + allMaps = new MultiMap(); + File.Delete("error-log.txt"); DOMConfigurator.Configure(new FileInfo("NHibernate.Tool.hbm2net.exe.config")); *************** *** 40,44 **** ArrayList mappingFiles = new ArrayList(); ! String outputDir = null; SupportClass.ListCollectionSupport generators = new SupportClass.ListCollectionSupport(); --- 46,50 ---- ArrayList mappingFiles = new ArrayList(); ! string outputDir = null; SupportClass.ListCollectionSupport generators = new SupportClass.ListCollectionSupport(); *************** *** 69,72 **** --- 75,83 ---- } } + else if ( args[i].IndexOf("*") > -1 ) + { + // Handle wildcards + mappingFiles.AddRange( GetFiles( args[ i ] ) ); + } else { *************** *** 99,103 **** XmlAttribute a = rootElement.Attributes["package"]; ! String pkg = null; if (a != null) { --- 110,114 ---- XmlAttribute a = rootElement.Attributes["package"]; ! string pkg = null; if (a != null) { *************** *** 105,116 **** } MappingElement me = new MappingElement(rootElement, null); ! IEnumerator classElements = rootElement.SelectNodes("urn:class", nsmgr).GetEnumerator(); MultiMap mm = MetaAttributeHelper.loadAndMergeMetaMap(rootElement, globalMetas); handleClass(pkg, me, classMappings, classElements, mm, false); ! classElements = rootElement.SelectNodes("urn:subclass", nsmgr).GetEnumerator(); handleClass(pkg, me, classMappings, classElements, mm, true); ! classElements = rootElement.SelectNodes("urn:joined-subclass", nsmgr).GetEnumerator(); handleClass(pkg, me, classMappings, classElements, mm, true); } --- 116,127 ---- } MappingElement me = new MappingElement(rootElement, null); ! IEnumerator classElements = rootElement.SelectNodes("class", nsmgr).GetEnumerator(); MultiMap mm = MetaAttributeHelper.loadAndMergeMetaMap(rootElement, globalMetas); handleClass(pkg, me, classMappings, classElements, mm, false); ! classElements = rootElement.SelectNodes("subclass", nsmgr).GetEnumerator(); handleClass(pkg, me, classMappings, classElements, mm, true); ! classElements = rootElement.SelectNodes("joined-subclass", nsmgr).GetEnumerator(); handleClass(pkg, me, classMappings, classElements, mm, true); } *************** *** 120,123 **** --- 131,138 ---- } } + + // Ok, pickup subclasses that we found before their superclasses + ProcessChildren( classMappings ); + // generate source files for (IEnumerator iterator = generators.GetEnumerator(); iterator.MoveNext(); ) *************** *** 134,138 **** } ! private static void handleClass(String classPackage, MappingElement me, Hashtable classMappings, IEnumerator classElements, MultiMap mm, bool extendz) { while (classElements.MoveNext()) --- 149,172 ---- } ! private static ICollection GetFiles( string fileSpec ) ! { ! int posn = fileSpec.LastIndexOf( '\\' ); ! string path = fileSpec.Substring( 0, posn ); ! string names = fileSpec.Substring( posn + 1 ); ! DirectoryInfo di = new DirectoryInfo( path ); ! ! FileInfo[] files = di.GetFiles( names ); ! ! ArrayList fileNames = new ArrayList( files.Length ); ! ! foreach ( FileInfo file in files ) ! { ! fileNames.Add( file.FullName ); ! } ! ! return fileNames; ! } ! ! private static void handleClass(string classPackage, MappingElement me, Hashtable classMappings, IEnumerator classElements, MultiMap mm, bool extendz) { while (classElements.MoveNext()) *************** *** 144,165 **** ClassMapping cmap = new ClassMapping(classPackage, clazz, me, mm); SupportClass.PutElement(classMappings, cmap.FullyQualifiedName, cmap); } else { ! String ex = (clazz.Attributes["extends"] == null?null:clazz.Attributes["extends"].Value); ! if ((Object) ex == null) { throw new MappingException("Missing extends attribute on <" + clazz.LocalName + " name=" + clazz.Attributes["name"].Value + ">"); } ! ClassMapping superclass = (ClassMapping) classMappings[ex]; if (superclass == null) { ! throw new MappingException("Cannot extend unmapped class " + ex); } ! ClassMapping subclassMapping = new ClassMapping(classPackage, me, superclass.ClassName, superclass, clazz, mm); ! superclass.addSubClass(subclassMapping); } } } } } \ No newline at end of file --- 178,259 ---- ClassMapping cmap = new ClassMapping(classPackage, clazz, me, mm); SupportClass.PutElement(classMappings, cmap.FullyQualifiedName, cmap); + SupportClass.PutElement(allMaps, cmap.FullyQualifiedName, cmap); } else { ! string ex = clazz.Attributes["extends"] == null ? null : clazz.Attributes["extends"].Value; ! if ((object) ex == null) { throw new MappingException("Missing extends attribute on <" + clazz.LocalName + " name=" + clazz.Attributes["name"].Value + ">"); } ! ClassMapping superclass = (ClassMapping) allMaps[ex]; if (superclass == null) { ! // Haven't seen the superclass yet, so record this and process at the end ! SubclassMapping orphan = new SubclassMapping(classPackage, me, ex, clazz, mm); ! children.Add( orphan ); } ! else ! { ! ClassMapping subclassMapping = new ClassMapping(classPackage, me, superclass.ClassName, superclass, clazz, mm); ! superclass.addSubClass(subclassMapping); ! SupportClass.PutElement(allMaps, subclassMapping.FullyQualifiedName, subclassMapping); ! } ! } ! } ! } ! ! /// <summary> ! /// Try to locate superclasses for any orphans we have ! /// </summary> ! private static void ProcessChildren( Hashtable classMappings ) ! { ! while ( FindParents( classMappings ) ) { } ! ! foreach( SubclassMapping child in children ) ! { ! if ( child.Orphaned ) ! { ! // Log that we had an orphan ! log.Warn( string.Format( "Cannot extend {0} child of unmapped class {1} ", child.Name, child.SuperClass ) ); } } } + + /// <summary> + /// Find parents for any orphans + /// </summary> + /// <returns></returns> + private static bool FindParents( Hashtable classMappings ) + { + if ( children.Count == 0 ) + { + // No parents to find + return false; + } + else + { + bool found = false; + + foreach( SubclassMapping child in children ) + { + if ( child.Orphaned ) + { + ClassMapping superclass = (ClassMapping) allMaps[ child.SuperClass ]; + if (superclass != null) + { + ClassMapping subclassMapping = new ClassMapping(child.ClassPackage, child.MappingElement, superclass.ClassName, superclass, child.Clazz, child.MultiMap); + superclass.addSubClass(subclassMapping); + // NB Can't remove it from the iterator, so record that we've found the parent. + child.Orphaned = false; + found = true; + } + } + } + + // Tell them if we found any + return found; + } + } } } \ No newline at end of file Index: NHibernate.Tool.hbm2net-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/NHibernate.Tool.hbm2net-1.1.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NHibernate.Tool.hbm2net-1.1.csproj 30 Dec 2004 16:54:54 -0000 1.1 --- NHibernate.Tool.hbm2net-1.1.csproj 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 207,210 **** --- 207,215 ---- /> <File + RelPath = "SubclassMapping.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "SupportClass.cs" SubType = "Code" Index: Generator.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/Generator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Generator.cs 30 Dec 2004 16:54:54 -0000 1.1 --- Generator.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 14,18 **** { private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); ! private void InitBlock() { --- 14,18 ---- { private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); ! private void InitBlock() { *************** *** 20,24 **** prefix = string.Empty; } ! virtual public String BaseDirName { get --- 20,24 ---- prefix = string.Empty; } ! virtual public string BaseDirName { get *************** *** 37,46 **** } ! private String rendererClass = "NHibernate.Tool.hbm2net.VelocityRenderer"; ! private String baseDirName = "generated"; ! private String packageName = null; ! private String suffix; ! private String prefix; ! private String extension = "cs"; private bool lowerFirstLetter = false; --- 37,46 ---- } ! private string rendererClass = "NHibernate.Tool.hbm2net.VelocityRenderer"; ! private string baseDirName = "generated"; ! private string packageName = null; ! private string suffix; ! private string prefix; ! private string extension = "cs"; private bool lowerFirstLetter = false; *************** *** 57,61 **** { InitBlock(); ! String value_Renamed = null; // set rendererClass field --- 57,61 ---- { InitBlock(); ! string value_Renamed = null; // set rendererClass field *************** *** 150,155 **** private void write(ClassMapping classMapping, IDictionary class2classmap, Renderer renderer) { ! String saveToPackage = renderer.getSaveToPackage(classMapping); ! String saveToClassName = renderer.getSaveToClassName(classMapping); FileInfo dir = this.getDir(saveToPackage); FileInfo file = new FileInfo(dir.FullName + "\\" + this.getFileName(saveToClassName)); --- 150,155 ---- private void write(ClassMapping classMapping, IDictionary class2classmap, Renderer renderer) { ! string saveToPackage = renderer.getSaveToPackage(classMapping); ! string saveToClassName = renderer.getSaveToClassName(classMapping); FileInfo dir = this.getDir(saveToPackage); FileInfo file = new FileInfo(dir.FullName + "\\" + this.getFileName(saveToClassName)); *************** *** 163,167 **** /// <summary> </summary> ! private String getFileName(String className) { return this.getName(className) + "." + this.extension; --- 163,167 ---- /// <summary> </summary> ! private string getFileName(string className) { return this.getName(className) + "." + this.extension; *************** *** 169,175 **** /// <summary> </summary> ! private String getName(String className) { ! String name = null; if (this.lowerFirstLetter) --- 169,175 ---- /// <summary> </summary> ! private string getName(string className) { ! string name = null; if (this.lowerFirstLetter) *************** *** 185,189 **** } ! private String getPackageName(String packageName) { if ((Object) this.packageName == null) --- 185,189 ---- } ! private string getPackageName(string packageName) { if ((Object) this.packageName == null) *************** *** 197,206 **** } /// <summary> </summary> ! private FileInfo getDir(String packageName) { FileInfo baseDir = new FileInfo(this.baseDirName); FileInfo dir = null; ! String p = getPackageName(packageName); dir = new FileInfo(baseDir.FullName + "\\" + p.Replace(StringHelper.Dot, Path.DirectorySeparatorChar)); --- 197,206 ---- } /// <summary> </summary> ! private FileInfo getDir(string packageName) { FileInfo baseDir = new FileInfo(this.baseDirName); FileInfo dir = null; ! string p = getPackageName(packageName); dir = new FileInfo(baseDir.FullName + "\\" + p.Replace(StringHelper.Dot, Path.DirectorySeparatorChar)); Index: BasicRenderer.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/BasicRenderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicRenderer.cs 30 Dec 2004 16:54:54 -0000 1.1 --- BasicRenderer.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 32,36 **** internal JavaTool javaTool; ! public override void render(System.String savedToPackage, System.String savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StreamWriter mainwriter) { mainwriter.WriteLine("using System;"); --- 32,36 ---- internal JavaTool javaTool; ! public override void render(string savedToPackage, string savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StreamWriter mainwriter) { mainwriter.WriteLine("using System;"); *************** *** 69,78 **** } ! System.String classScope = classMapping.Scope; ! System.String declarationType = classMapping.DeclarationType; //classMapping.addImport(typeof(System.Runtime.Serialization.ISerializable)); ! //String modifiers = classMapping.getModifiers(); if (classMapping.shouldBeAbstract() && (classScope.IndexOf("abstract") == - 1)) { --- 69,78 ---- } ! string classScope = classMapping.Scope; ! string declarationType = classMapping.DeclarationType; //classMapping.addImport(typeof(System.Runtime.Serialization.ISerializable)); ! //string modifiers = classMapping.getModifiers(); if (classMapping.shouldBeAbstract() && (classScope.IndexOf("abstract") == - 1)) { *************** *** 116,121 **** } ! System.String vetoSupport = makeSupportField("vetos", classMapping.AllFields); ! System.String changeSupport = makeSupportField("changes", classMapping.AllFields); int fieldTypes = doFieldAccessors(classMapping, class2classmap, propWriter, vetoSupport, changeSupport); --- 116,121 ---- } ! string vetoSupport = makeSupportField("vetos", classMapping.AllFields); ! string changeSupport = makeSupportField("changes", classMapping.AllFields); int fieldTypes = doFieldAccessors(classMapping, class2classmap, propWriter, vetoSupport, changeSupport); *************** *** 135,139 **** while (iter.MoveNext()) { ! System.String code = iter.Current.ToString(); propWriter.WriteLine(code); } --- 135,139 ---- while (iter.MoveNext()) { ! string code = iter.Current.ToString(); propWriter.WriteLine(code); } *************** *** 163,167 **** /// <param name="vetoSupport"></param> /// <param name="writer"></param> ! private void doSupportMethods(int fieldTypes, System.String vetoSupport, System.String changeSupport, System.IO.StringWriter writer) { if ((fieldTypes & CONSTRAINT) == CONSTRAINT) --- 163,167 ---- /// <param name="vetoSupport"></param> /// <param name="writer"></param> ! private void doSupportMethods(int fieldTypes, string vetoSupport, string changeSupport, System.IO.StringWriter writer) { if ((fieldTypes & CONSTRAINT) == CONSTRAINT) *************** *** 195,199 **** /// <param name="writer"> /// </param> ! private void doSupports(int fieldTypes, ClassMapping classMapping, System.String vetoSupport, System.String changeSupport, System.IO.StringWriter writer) { if ((fieldTypes & CONSTRAINT) == CONSTRAINT) --- 195,199 ---- /// <param name="writer"> /// </param> ! private void doSupports(int fieldTypes, ClassMapping classMapping, string vetoSupport, string changeSupport, System.IO.StringWriter writer) { if ((fieldTypes & CONSTRAINT) == CONSTRAINT) *************** *** 210,214 **** ! public virtual void doConstructors(System.String savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer) { // full constructor --- 210,214 ---- ! public virtual void doConstructors(string savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer) { // full constructor *************** *** 216,220 **** writer.WriteLine(" /// <summary>\n /// full constructor\n /// </summary>"); ! System.String fullCons = " public " + savedToClass + StringHelper.OpenParen; fullCons += javaTool.fieldsAsParameters(allFieldsForFullConstructor, classMapping, class2classmap); --- 216,220 ---- writer.WriteLine(" /// <summary>\n /// full constructor\n /// </summary>"); ! string fullCons = " public " + savedToClass + StringHelper.OpenParen; fullCons += javaTool.fieldsAsParameters(allFieldsForFullConstructor, classMapping, class2classmap); *************** *** 270,274 **** writer.WriteLine(" /// <summary>\n /// minimal constructor\n /// </summary>"); ! System.String minCons = " public " + savedToClass + "("; bool first = true; for (System.Collections.IEnumerator fields = allFieldsForMinimalConstructor.GetEnumerator(); fields.MoveNext(); ) --- 270,274 ---- writer.WriteLine(" /// <summary>\n /// minimal constructor\n /// </summary>"); ! string minCons = " public " + savedToClass + "("; bool first = true; for (System.Collections.IEnumerator fields = allFieldsForMinimalConstructor.GetEnumerator(); fields.MoveNext(); ) *************** *** 342,346 **** if (field.GeneratedAsProperty) { ! System.String fieldScope = getFieldScope(field, "scope-field", "private"); writer.WriteLine(" /// <summary>\n /// Holder for " + (field.Nullable && !field.Identifier?"nullable ":string.Empty) + (field.Identifier?"identifier":"persistent") + " field " + field.FieldName + "\n /// </summary>"); --- 342,346 ---- if (field.GeneratedAsProperty) { ! string fieldScope = getFieldScope(field, "scope-field", "private"); writer.WriteLine(" /// <summary>\n /// Holder for " + (field.Nullable && !field.Identifier?"nullable ":string.Empty) + (field.Identifier?"identifier":"persistent") + " field " + field.FieldName + "\n /// </summary>"); *************** *** 357,361 **** } ! public virtual void doEqualsAndHashCode(System.String savedToClass, ClassMapping classMapping, System.IO.StringWriter writer) { if (classMapping.mustImplementEquals()) --- 357,361 ---- } ! public virtual void doEqualsAndHashCode(string savedToClass, ClassMapping classMapping, System.IO.StringWriter writer) { if (classMapping.mustImplementEquals()) *************** *** 449,453 **** internal static System.Collections.IDictionary primitiveToObject; ! public virtual int doFieldAccessors(ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer, System.String vetoSupport, System.String changeSupport) { int fieldTypes = ORDINARY; --- 449,453 ---- internal static System.Collections.IDictionary primitiveToObject; ! public virtual int doFieldAccessors(ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer, string vetoSupport, string changeSupport) { int fieldTypes = ORDINARY; *************** *** 462,466 **** } ! private int doFields(ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer, System.String vetoSupport, System.String changeSupport, int fieldTypes, SupportClass.ListCollectionSupport fieldz) { // field accessors --- 462,466 ---- } ! private int doFields(ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer, string vetoSupport, string changeSupport, int fieldTypes, SupportClass.ListCollectionSupport fieldz) { // field accessors *************** *** 472,476 **** // getter ! System.String getAccessScope = getFieldScope(field, "scope-get", "public"); --- 472,476 ---- // getter ! string getAccessScope = getFieldScope(field, "scope-get", "public"); *************** *** 499,503 **** if (field.getMeta("beans-property-type") != null) { ! System.String beansPropertyType = field.getMetaAsString("beans-property-type").Trim().ToLower(); if (beansPropertyType.Equals("constraint")) { --- 499,503 ---- if (field.getMeta("beans-property-type") != null) { ! string beansPropertyType = field.getMetaAsString("beans-property-type").Trim().ToLower(); if (beansPropertyType.Equals("constraint")) { *************** *** 511,515 **** } } ! System.String setAccessScope = getFieldScope(field, "scope-set", "public"); writer.Write(" set"); writer.Write((fieldType & CONSTRAINT) == CONSTRAINT?" throws PropertyVetoException ":""); --- 511,515 ---- } } ! string setAccessScope = getFieldScope(field, "scope-set", "public"); writer.Write(" set"); writer.Write((fieldType & CONSTRAINT) == CONSTRAINT?" throws PropertyVetoException ":""); *************** *** 524,528 **** if ((fieldType & CONSTRAINT) == CONSTRAINT || (fieldType & BOUND) == BOUND) { ! writer.WriteLine(" Object oldValue = " + getFieldAsObject(true, field) + ";"); } if ((fieldType & CONSTRAINT) == CONSTRAINT) --- 524,528 ---- if ((fieldType & CONSTRAINT) == CONSTRAINT || (fieldType & BOUND) == BOUND) { ! writer.WriteLine(" object oldValue = " + getFieldAsObject(true, field) + ";"); } if ((fieldType & CONSTRAINT) == CONSTRAINT) *************** *** 551,555 **** ClassName foreignClass = field.getForeignClass(); ! String trueforeign = getTrueTypeName(foreignClass, class2classmap); classMapping.addImport(trueforeign); --- 551,555 ---- ClassName foreignClass = field.getForeignClass(); ! string trueforeign = getTrueTypeName(foreignClass, class2classmap); classMapping.addImport(trueforeign); *************** *** 570,574 **** } ! String addAccessScope = getFieldScope(field, "scope", "scope-add"); writer.println(" " + setAccessScope + " void add" + field.getAsSuffix() + StringHelper.OPEN + shortenType(trueforeign, classMapping.getImports()) + " a" + field.getName() + ") {"); writer.println(" this." + getterType + field.getAsSuffix() + "().add(a" + field.getName() + ");"); --- 570,574 ---- } ! string addAccessScope = getFieldScope(field, "scope", "scope-add"); writer.println(" " + setAccessScope + " void add" + field.getAsSuffix() + StringHelper.OPEN + shortenType(trueforeign, classMapping.getImports()) + " a" + field.getName() + ") {"); writer.println(" this." + getterType + field.getAsSuffix() + "().add(a" + field.getName() + ");"); *************** *** 591,601 **** } ! protected internal virtual System.String makeSupportField(System.String fieldName, SupportClass.ListCollectionSupport fieldList) { ! System.String suffix = ""; bool needSuffix = false; for (System.Collections.IEnumerator fields = fieldList.GetEnumerator(); fields.MoveNext(); ) { ! System.String name = ((FieldProperty) fields.Current).FieldName; if (name.Equals(fieldName)) needSuffix = true; --- 591,601 ---- } ! protected internal virtual string makeSupportField(string fieldName, SupportClass.ListCollectionSupport fieldList) { ! string suffix = ""; bool needSuffix = false; for (System.Collections.IEnumerator fields = fieldList.GetEnumerator(); fields.MoveNext(); ) { ! string name = ((FieldProperty) fields.Current).FieldName; if (name.Equals(fieldName)) needSuffix = true; *************** *** 605,614 **** } ! private System.String getFieldAsObject(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; if (type != null && type.Primitive && !type.Array) { ! System.String typeName = (System.String) primitiveToObject[type.Name]; typeName = "new " + typeName + "( "; typeName += (prependThis?"this.":""); --- 605,614 ---- } ! private string getFieldAsObject(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; if (type != null && type.Primitive && !type.Array) { ! string typeName = (System.String) primitiveToObject[type.Name]; typeName = "new " + typeName + "( "; typeName += (prependThis?"this.":""); Index: DOMRenderer.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/DOMRenderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DOMRenderer.cs 30 Dec 2004 16:54:54 -0000 1.1 --- DOMRenderer.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 10,14 **** public class DOMRenderer : AbstractRenderer { ! public override void render(String savedToPackage, String savedToClass, ClassMapping classMapping, IDictionary class2classmap, StreamWriter writer) { } --- 10,14 ---- public class DOMRenderer : AbstractRenderer { ! public override void render(string savedToPackage, string savedToClass, ClassMapping classMapping, IDictionary class2classmap, StreamWriter writer) { } Index: FieldProperty.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/FieldProperty.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FieldProperty.cs 30 Dec 2004 16:54:54 -0000 1.1 --- FieldProperty.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 7,12 **** namespace NHibernate.Tool.hbm2net { - - public class FieldProperty:MappingElement { --- 7,10 ---- *************** *** 29,33 **** } } ! virtual public String FieldName { get --- 27,31 ---- } } ! virtual public string FieldName { get *************** *** 37,41 **** } ! virtual public String AccessorName { get --- 35,39 ---- } ! virtual public string AccessorName { get *************** *** 45,57 **** } ! private String GetterType { get { ! return (FullyQualifiedTypeName.Equals("boolean"))?"is":"get"; } } ! virtual public String FullyQualifiedTypeName { get --- 43,55 ---- } ! private string GetterType { get { ! return (FullyQualifiedTypeName.Equals("boolean")) ? "is" : "get"; } } ! virtual public string FullyQualifiedTypeName { get *************** *** 135,139 **** /// <returns> String /// </returns> ! virtual public String GetterSignature { get --- 133,137 ---- /// <returns> String /// </returns> ! virtual public string GetterSignature { get *************** *** 172,176 **** } ! virtual public String FieldScope { get --- 170,174 ---- } ! virtual public string FieldScope { get *************** *** 180,184 **** } ! virtual public String PropertyGetScope { get --- 178,182 ---- } ! virtual public string PropertyGetScope { get *************** *** 188,192 **** } ! virtual public String PropertySetScope { get --- 186,190 ---- } ! virtual public string PropertySetScope { get *************** *** 198,205 **** /// <summary>the field name </summary> ! private String fieldName = null; /// <summary>the property name </summary> ! private String accessorName = null; /// <summary>true if this is part of an id </summary> --- 196,203 ---- /// <summary>the field name </summary> ! private string fieldName = null; /// <summary>the property name </summary> ! private string accessorName = null; /// <summary>true if this is part of an id </summary> *************** *** 215,236 **** private ClassName implementationClassName; ! private ClassMapping parentClass; ! public FieldProperty(Element element, MappingElement parent, String name, ClassName type, bool nullable, MultiMap metaattribs):base(element, parent) { initWith(name, type, type, nullable, id, false, null, null, metaattribs); } ! public FieldProperty(Element element, MappingElement parent, String name, ClassName type, bool nullable, bool id, bool generated, MultiMap metaattribs):base(element, parent) { initWith(name, type, type, nullable, id, generated, null, null, metaattribs); } ! public FieldProperty(Element element, MappingElement parent, String name, ClassName type, ClassName implementationClassName, bool nullable, ClassName foreignClass, SupportClass.SetSupport foreignKeys, MultiMap metaattribs):base(element, parent) { initWith(name, type, implementationClassName, nullable, id, false, foreignClass, foreignKeys, metaattribs); } ! protected internal virtual void initWith(String name, ClassName type, ClassName implementationClassName, bool nullable, bool id, bool generated, ClassName foreignClass, SupportClass.SetSupport foreignKeys, MultiMap metaattribs) { this.fieldName = name; --- 213,234 ---- private ClassName implementationClassName; ! private ClassMapping parentClass = null; ! public FieldProperty(Element element, MappingElement parent, string name, ClassName type, bool nullable, MultiMap metaattribs):base(element, parent) { initWith(name, type, type, nullable, id, false, null, null, metaattribs); } ! public FieldProperty(Element element, MappingElement parent, string name, ClassName type, bool nullable, bool id, bool generated, MultiMap metaattribs):base(element, parent) { initWith(name, type, type, nullable, id, generated, null, null, metaattribs); } ! public FieldProperty(Element element, MappingElement parent, string name, ClassName type, ClassName implementationClassName, bool nullable, ClassName foreignClass, SupportClass.SetSupport foreignKeys, MultiMap metaattribs):base(element, parent) { initWith(name, type, implementationClassName, nullable, id, false, foreignClass, foreignKeys, metaattribs); } ! protected internal virtual void initWith(string name, ClassName type, ClassName implementationClassName, bool nullable, bool id, bool generated, ClassName foreignClass, SupportClass.SetSupport foreignKeys, MultiMap metaattribs) { this.fieldName = name; *************** *** 254,258 **** /// <returns> /// </returns> ! private String beancapitalize(String fieldname) { if ((Object) fieldname == null || fieldname.Length == 0) --- 252,256 ---- /// <returns> /// </returns> ! private string beancapitalize(string fieldname) { if ((Object) fieldname == null || fieldname.Length == 0) *************** *** 270,279 **** } ! public override String ToString() { return FullyQualifiedTypeName + ":" + FieldName; } ! public virtual String getScope(String localScopeName, String defaultScope) { if ((Object) defaultScope == null) --- 268,277 ---- } ! public override string ToString() { return FullyQualifiedTypeName + ":" + FieldName; } ! public virtual string getScope(string localScopeName, string defaultScope) { if ((Object) defaultScope == null) Index: ClassMapping.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/ClassMapping.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassMapping.cs 30 Dec 2004 16:54:54 -0000 1.1 --- ClassMapping.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 15,31 **** namespace NHibernate.Tool.hbm2net { - - public class ClassMapping:MappingElement { private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); ! private void InitBlock() { [...1237 lines suppressed...] ! public override String ToString() { return "ClassMapping: " + name.FullyQualifiedName; --- 1021,1025 ---- } ! public override string ToString() { return "ClassMapping: " + name.FullyQualifiedName; *************** *** 990,996 **** addImport(clazz.FullName); } - static ClassMapping() - { - } } } \ No newline at end of file --- 1035,1038 ---- Index: QueryBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/QueryBuilder.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QueryBuilder.cs 30 Dec 2004 16:54:54 -0000 1.1 --- QueryBuilder.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 34,38 **** /// <returns> The query in string form /// </returns> ! virtual public String Query { get --- 34,38 ---- /// <returns> The query in string form /// </returns> ! virtual public string Query { get *************** *** 69,73 **** for (int i = 0; i < criteria.Count; i++) { ! String thisCriteria = (String) criteria[i]; sb.Append(" " + thisCriteria + " "); //UPGRADE_TODO: The equivalent in .NET for method 'java.util.ArrayList.size' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"' --- 69,73 ---- for (int i = 0; i < criteria.Count; i++) { ! string thisCriteria = (String) criteria[i]; sb.Append(" " + thisCriteria + " "); //UPGRADE_TODO: The equivalent in .NET for method 'java.util.ArrayList.size' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"' *************** *** 92,100 **** } ! virtual public String ParamTypesAsString { get { ! String types = "new Type[] {"; // Always need the local class as an association type types += ("Hibernate.association(" + localClass.Name + ".class), "); --- 92,100 ---- } ! virtual public string ParamTypesAsString { get { ! string types = "new Type[] {"; // Always need the local class as an association type types += ("Hibernate.association(" + localClass.Name + ".class), "); *************** *** 102,106 **** for (int i = 0; i < criteriaParamTypes.Count; i++) { ! String s = (String) criteriaParamTypes[i]; types += s; //UPGRADE_TODO: The equivalent in .NET for method 'java.util.ArrayList.size' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"' --- 102,106 ---- for (int i = 0; i < criteriaParamTypes.Count; i++) { ! string s = (String) criteriaParamTypes[i]; types += s; //UPGRADE_TODO: The equivalent in .NET for method 'java.util.ArrayList.size' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"' *************** *** 123,131 **** } ! virtual public String ParamsAsString { get { ! String types = "new Object[] {"; // Always joining via the local class types += (localClass.Name.ToLower() + ", "); --- 123,131 ---- } ! virtual public string ParamsAsString { get { ! string types = "new Object[] {"; // Always joining via the local class types += (localClass.Name.ToLower() + ", "); *************** *** 133,137 **** for (int i = 0; i < params_Renamed.Count; i++) { ! String s = (String) params_Renamed[i]; types += s; //UPGRADE_TODO: The equivalent in .NET for method 'java.util.ArrayList.size' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"' --- 133,137 ---- for (int i = 0; i < params_Renamed.Count; i++) { ! string s = (String) params_Renamed[i]; types += s; //UPGRADE_TODO: The equivalent in .NET for method 'java.util.ArrayList.size' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"' *************** *** 146,153 **** } ! public const String CRITERIA_EQUALS = "="; ! public const String CRITERIA_GREATER_THAN = ">"; ! public const String CRITERIA_LESS_THAN = "<"; ! public const String CRITERIA_LIKE = "LIKE"; // List of strings that will later be put together to form the query --- 146,153 ---- } ! public const string CRITERIA_EQUALS = "="; ! public const string CRITERIA_GREATER_THAN = ">"; ! public const string CRITERIA_LESS_THAN = "<"; ! public const string CRITERIA_LIKE = "LIKE"; // List of strings that will later be put together to form the query *************** *** 170,174 **** private ClassMapping localClass = null; private ClassMapping foreignClass = null; ! private String joinFieldName = ""; public QueryBuilder() --- 170,174 ---- private ClassMapping localClass = null; private ClassMapping foreignClass = null; ! private string joinFieldName = ""; public QueryBuilder() *************** *** 177,181 **** } ! public virtual void setForeignClass(ClassName foreignClass, IDictionary classMappings, String joinFieldName) { //UPGRADE_TODO: Method 'java.util.Map.get' was converted to 'System.Collections.IDictionary.Item' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilMapget_javalangObject"' --- 177,181 ---- } ! public virtual void setForeignClass(ClassName foreignClass, IDictionary classMappings, string joinFieldName) { //UPGRADE_TODO: Method 'java.util.Map.get' was converted to 'System.Collections.IDictionary.Item' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilMapget_javalangObject"' *************** *** 185,191 **** } ! public virtual void addCritera(ClassMapping criteriaClass, FieldProperty field, String condition) { ! String newCritera = criteriaClass.Name.ToLower() + "." + field.FieldName + condition + "?"; //UPGRADE_TODO: The equivalent in .NET for method 'java.util.ArrayList.add' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"' params_Renamed.Add(FinderRenderer.getFieldAsObject(false, field)); --- 185,191 ---- } ! public virtual void addCritera(ClassMapping criteriaClass, FieldProperty field, string condition) { ! string newCritera = criteriaClass.Name.ToLower() + "." + field.FieldName + condition + "?"; //UPGRADE_TODO: The equivalent in .NET for method 'java.util.ArrayList.add' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"' params_Renamed.Add(FinderRenderer.getFieldAsObject(false, field)); Index: MappingElement.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/MappingElement.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MappingElement.cs 30 Dec 2004 16:54:54 -0000 1.1 --- MappingElement.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 71,75 **** /// <summary>Returns true if this element has the meta attribute </summary> ! public virtual bool hasMeta(String attribute) { return metaattribs.ContainsKey(attribute); --- 71,75 ---- /// <summary>Returns true if this element has the meta attribute </summary> ! public virtual bool hasMeta(string attribute) { return metaattribs.ContainsKey(attribute); *************** *** 77,81 **** /* Given a key, return the list of metaattribs. Can return null! */ ! public virtual SupportClass.ListCollectionSupport getMeta(String attribute) { return (SupportClass.ListCollectionSupport) metaattribs[attribute]; --- 77,81 ---- /* Given a key, return the list of metaattribs. Can return null! */ ! public virtual SupportClass.ListCollectionSupport getMeta(string attribute) { return (SupportClass.ListCollectionSupport) metaattribs[attribute]; *************** *** 87,91 **** /// <returns> String /// </returns> ! public virtual String getMetaAsString(String attribute) { SupportClass.ListCollectionSupport c = getMeta(attribute); --- 87,91 ---- /// <returns> String /// </returns> ! public virtual string getMetaAsString(string attribute) { SupportClass.ListCollectionSupport c = getMeta(attribute); *************** *** 94,108 **** } ! public virtual String getMetaAsString(String attribute, String seperator) { return MetaAttributeHelper.getMetaAsString(getMeta(attribute), seperator); } ! public virtual bool getMetaAsBool(String attribute) { return getMetaAsBool(attribute, false); } ! public virtual bool getMetaAsBool(String attribute, bool defaultValue) { SupportClass.ListCollectionSupport c = getMeta(attribute); --- 94,108 ---- } ! public virtual string getMetaAsString(string attribute, string seperator) { return MetaAttributeHelper.getMetaAsString(getMeta(attribute), seperator); } ! public virtual bool getMetaAsBool(string attribute) { return getMetaAsBool(attribute, false); } ! public virtual bool getMetaAsBool(string attribute, bool defaultValue) { SupportClass.ListCollectionSupport c = getMeta(attribute); Index: MethodSignatureBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/src/NHibernate.Tool.hbm2net/MethodSignatureBuilder.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MethodSignatureBuilder.cs 30 Dec 2004 16:54:54 -0000 1.1 --- MethodSignatureBuilder.cs 1 Mar 2005 16:24:39 -0000 1.2 *************** *** 21,25 **** throwsList = new ArrayList(); } ! virtual public String Name { get --- 21,25 ---- throwsList = new ArrayList(); } ! virtual... [truncated message content] |