From: Peter S. <sz...@us...> - 2004-09-13 12:55:34
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13487 Modified Files: FinderRenderer.cs Generator.cs JavaTool.cs MappingElement.cs MetaAttributeHelper.cs MethodSignatureBuilder.cs QueryBuilder.cs Renderer.cs SupportClass.cs Log Message: Reordered the code a bit Index: Renderer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/Renderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Renderer.cs 25 Jul 2004 11:41:03 -0000 1.1 --- Renderer.cs 13 Sep 2004 12:55:25 -0000 1.2 *************** *** 1,12 **** using System; namespace NHibernate.Tool.hbm2net { - - public interface Renderer { /// <summary>Called with the optional list of properties from config.xml </summary> ! void configure(System.Collections.Specialized.NameValueCollection properties); /// <summary> </summary> --- 1,14 ---- using System; + using System.Collections; + using System.Collections.Specialized; + using System.IO; + namespace NHibernate.Tool.hbm2net { public interface Renderer { /// <summary>Called with the optional list of properties from config.xml </summary> ! void configure(NameValueCollection properties); /// <summary> </summary> *************** *** 22,26 **** /// @throws Exception /// </param> ! void render(System.String savedToPackage, System.String savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.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. *************** *** 31,35 **** /// <returns> the package name the class should be saved to /// </returns> ! System.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. *************** *** 40,44 **** /// <returns> the class name the class should be saved to /// </returns> ! System.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: QueryBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/QueryBuilder.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QueryBuilder.cs 25 Jul 2004 11:41:03 -0000 1.1 --- QueryBuilder.cs 13 Sep 2004 12:55:25 -0000 1.2 *************** *** 1,3 **** --- 1,5 ---- using System; + using System.Collections; + using System.Text; using Type = NHibernate.Type.TypeType; namespace NHibernate.Tool.hbm2net *************** *** 12,20 **** { //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! objects = new System.Collections.ArrayList(); //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! joinConditions = new System.Collections.ArrayList(); //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! criteria = new System.Collections.ArrayList(); //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' params_Renamed = new SupportClass.ListCollectionSupport(); --- 14,22 ---- { //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! objects = new ArrayList(); //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! joinConditions = new ArrayList(); //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! criteria = new ArrayList(); //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' params_Renamed = new SupportClass.ListCollectionSupport(); *************** *** 32,40 **** /// <returns> The query in string form /// </returns> ! virtual public System.String Query { get { ! System.Text.StringBuilder sb = new System.Text.StringBuilder("select "); // Foreign class is what we're selecting from --- 34,42 ---- /// <returns> The query in string form /// </returns> ! virtual public String Query { get { ! StringBuilder sb = new StringBuilder("select "); // Foreign class is what we're selecting from *************** *** 67,71 **** for (int i = 0; i < criteria.Count; i++) { ! System.String thisCriteria = (System.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"' *************** *** 90,98 **** } ! virtual public System.String ParamTypesAsString { get { ! System.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), "); *************** *** 100,104 **** for (int i = 0; i < criteriaParamTypes.Count; i++) { ! System.String s = (System.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"' *************** *** 121,129 **** } ! virtual public System.String ParamsAsString { get { ! System.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() + ", "); *************** *** 131,135 **** for (int i = 0; i < params_Renamed.Count; i++) { ! System.String s = (System.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"' *************** *** 144,162 **** } ! public const System.String CRITERIA_EQUALS = "="; ! public const System.String CRITERIA_GREATER_THAN = ">"; ! public const System.String CRITERIA_LESS_THAN = "<"; ! public const System.String CRITERIA_LIKE = "LIKE"; // List of strings that will later be put together to form the query //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'objects' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private System.Collections.ArrayList objects; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'joinConditions' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private System.Collections.ArrayList joinConditions; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'criteria' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private System.Collections.ArrayList criteria; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'params_Renamed' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' --- 146,164 ---- } ! 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 //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'objects' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private ArrayList objects; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'joinConditions' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private ArrayList joinConditions; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'criteria' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private ArrayList criteria; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'params_Renamed' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' *************** *** 168,172 **** private ClassMapping localClass = null; private ClassMapping foreignClass = null; ! private System.String joinFieldName = ""; public QueryBuilder() --- 170,174 ---- private ClassMapping localClass = null; private ClassMapping foreignClass = null; ! private String joinFieldName = ""; public QueryBuilder() *************** *** 175,179 **** } ! public virtual void setForeignClass(ClassName foreignClass, System.Collections.IDictionary classMappings, System.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"' *************** *** 183,189 **** } ! public virtual void addCritera(ClassMapping criteriaClass, FieldProperty field, System.String condition) { ! System.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: Generator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/Generator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Generator.cs 25 Jul 2004 11:41:03 -0000 1.1 --- Generator.cs 13 Sep 2004 12:55:24 -0000 1.2 *************** *** 1,14 **** using System; ! using StringHelper = NHibernate.Util.StringHelper; using Element = System.Xml.XmlElement; namespace NHibernate.Tool.hbm2net { - - /// <summary> </summary> public class Generator { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private void InitBlock() --- 1,17 ---- using System; ! using System.Collections; ! using System.Collections.Specialized; ! using System.IO; ! using System.Reflection; ! using log4net; ! using NHibernate.Util; using Element = System.Xml.XmlElement; namespace NHibernate.Tool.hbm2net { /// <summary> </summary> public class Generator { ! private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private void InitBlock() *************** *** 17,21 **** prefix = string.Empty; } ! virtual public System.String BaseDirName { get --- 20,24 ---- prefix = string.Empty; } ! virtual public String BaseDirName { get *************** *** 26,30 **** set { ! if ((System.Object) value != null) { this.baseDirName = value; --- 29,33 ---- set { ! if ((Object) value != null) { this.baseDirName = value; *************** *** 34,46 **** } ! private System.String rendererClass = "NHibernate.Tool.hbm2net.VelocityRenderer"; ! private System.String baseDirName = "generated"; ! private System.String packageName = null; ! private System.String suffix; ! private System.String prefix; ! private System.String extension = "cs"; private bool lowerFirstLetter = false; ! public static System.Collections.Specialized.NameValueCollection params_Renamed = new System.Collections.Specialized.NameValueCollection(); /// <summary> Constructs a new Generator using the defaults.</summary> --- 37,49 ---- } ! 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; ! public static NameValueCollection params_Renamed = new NameValueCollection(); /// <summary> Constructs a new Generator using the defaults.</summary> *************** *** 54,67 **** { InitBlock(); ! System.String value_Renamed = null; // set rendererClass field ! if ((System.Object) (this.rendererClass = (generateElement.Attributes["renderer"] == null?null:generateElement.Attributes["renderer"].Value)) == null) { ! throw new System.Exception("attribute renderer is required."); } // set dirName field ! if ((System.Object) (value_Renamed = (generateElement.Attributes["dir"] == null?null:generateElement.Attributes["dir"].Value)) != null) { this.baseDirName = value_Renamed; --- 57,70 ---- { InitBlock(); ! String value_Renamed = null; // set rendererClass field ! if ((Object) (this.rendererClass = (generateElement.Attributes["renderer"] == null?null:generateElement.Attributes["renderer"].Value)) == null) { ! throw new Exception("attribute renderer is required."); } // set dirName field ! if ((Object) (value_Renamed = (generateElement.Attributes["dir"] == null?null:generateElement.Attributes["dir"].Value)) != null) { this.baseDirName = value_Renamed; *************** *** 72,76 **** // set prefix ! if ((System.Object) (value_Renamed = (generateElement.Attributes["prefix"] == null?null:generateElement.Attributes["prefix"].Value)) != null) { this.prefix = value_Renamed; --- 75,79 ---- // set prefix ! if ((Object) (value_Renamed = (generateElement.Attributes["prefix"] == null?null:generateElement.Attributes["prefix"].Value)) != null) { this.prefix = value_Renamed; *************** *** 78,82 **** // set suffix ! if ((System.Object) (value_Renamed = (generateElement.Attributes["suffix"] == null?null:generateElement.Attributes["suffix"].Value)) != null) { this.suffix = value_Renamed; --- 81,85 ---- // set suffix ! if ((Object) (value_Renamed = (generateElement.Attributes["suffix"] == null?null:generateElement.Attributes["suffix"].Value)) != null) { this.suffix = value_Renamed; *************** *** 84,88 **** // set extension ! if ((System.Object) (value_Renamed = (generateElement.Attributes["extension"] == null?null:generateElement.Attributes["extension"].Value)) != null) { this.extension = value_Renamed; --- 87,91 ---- // set extension ! if ((Object) (value_Renamed = (generateElement.Attributes["extension"] == null?null:generateElement.Attributes["extension"].Value)) != null) { this.extension = value_Renamed; *************** *** 93,101 **** try { ! this.lowerFirstLetter = System.Boolean.Parse(value_Renamed); } catch{} ! System.Collections.IEnumerator iter = generateElement.SelectNodes("param").GetEnumerator(); while (iter.MoveNext()) { --- 96,104 ---- try { ! this.lowerFirstLetter = Boolean.Parse(value_Renamed); } catch{} ! IEnumerator iter = generateElement.SelectNodes("param").GetEnumerator(); while (iter.MoveNext()) { *************** *** 106,110 **** /// <summary> </summary> ! public virtual void generate(System.Collections.IDictionary classMappingsCol) { log.Info("Generating " + classMappingsCol.Count + " in " + BaseDirName); --- 109,113 ---- /// <summary> </summary> ! public virtual void generate(IDictionary classMappingsCol) { log.Info("Generating " + classMappingsCol.Count + " in " + BaseDirName); *************** *** 115,119 **** /// <summary>Running through actual classes </summary> ! for (System.Collections.IEnumerator classMappings = classMappingsCol.Values.GetEnumerator(); classMappings.MoveNext(); ) { ClassMapping classMapping = (ClassMapping) classMappings.Current; --- 118,122 ---- /// <summary>Running through actual classes </summary> ! for (IEnumerator classMappings = classMappingsCol.Values.GetEnumerator(); classMappings.MoveNext(); ) { ClassMapping classMapping = (ClassMapping) classMappings.Current; *************** *** 121,125 **** } /// <summary>Running through components </summary> ! for (System.Collections.IEnumerator cmpMappings = ClassMapping.Components; cmpMappings.MoveNext(); ) { ClassMapping mapping = (ClassMapping) cmpMappings.Current; --- 124,128 ---- } /// <summary>Running through components </summary> ! for (IEnumerator cmpMappings = ClassMapping.Components; cmpMappings.MoveNext(); ) { ClassMapping mapping = (ClassMapping) cmpMappings.Current; *************** *** 128,132 **** } ! private void writeRecur(ClassMapping classMapping, System.Collections.IDictionary class2classmap, Renderer renderer) { --- 131,135 ---- } ! private void writeRecur(ClassMapping classMapping, IDictionary class2classmap, Renderer renderer) { *************** *** 135,139 **** if (!(classMapping.Subclasses.Count == 0)) { ! System.Collections.IEnumerator it = classMapping.Subclasses.GetEnumerator(); while (it.MoveNext()) { --- 138,142 ---- if (!(classMapping.Subclasses.Count == 0)) { ! IEnumerator it = classMapping.Subclasses.GetEnumerator(); while (it.MoveNext()) { *************** *** 145,157 **** /// <summary> </summary> ! private void write(ClassMapping classMapping, System.Collections.IDictionary class2classmap, Renderer renderer) { ! System.String saveToPackage = renderer.getSaveToPackage(classMapping); ! System.String saveToClassName = renderer.getSaveToClassName(classMapping); ! System.IO.FileInfo dir = this.getDir(saveToPackage); ! System.IO.FileInfo file = new System.IO.FileInfo(dir.FullName + "\\" + this.getFileName(saveToClassName)); log.Debug("Writing " + file); ! System.IO.StreamWriter writer = new System.IO.StreamWriter(new System.IO.FileStream(file.FullName, System.IO.FileMode.Create)); renderer.render(getPackageName(saveToPackage), getName(saveToClassName), classMapping, class2classmap, writer); --- 148,160 ---- /// <summary> </summary> ! 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)); log.Debug("Writing " + file); ! StreamWriter writer = new StreamWriter(new FileStream(file.FullName, FileMode.Create)); renderer.render(getPackageName(saveToPackage), getName(saveToClassName), classMapping, class2classmap, writer); *************** *** 160,164 **** /// <summary> </summary> ! private System.String getFileName(System.String className) { return this.getName(className) + "." + this.extension; --- 163,167 ---- /// <summary> </summary> ! private String getFileName(String className) { return this.getName(className) + "." + this.extension; *************** *** 166,172 **** /// <summary> </summary> ! private System.String getName(System.String className) { ! System.String name = null; if (this.lowerFirstLetter) --- 169,175 ---- /// <summary> </summary> ! private String getName(String className) { ! String name = null; if (this.lowerFirstLetter) *************** *** 182,190 **** } ! private System.String getPackageName(System.String packageName) { ! if ((System.Object) this.packageName == null) { ! return (System.Object) packageName == null?string.Empty:packageName; } else --- 185,193 ---- } ! private String getPackageName(String packageName) { ! if ((Object) this.packageName == null) { ! return (Object) packageName == null?string.Empty:packageName; } else *************** *** 194,225 **** } /// <summary> </summary> ! private System.IO.FileInfo getDir(System.String packageName) { ! System.IO.FileInfo baseDir = new System.IO.FileInfo(this.baseDirName); ! System.IO.FileInfo dir = null; ! System.String p = getPackageName(packageName); ! dir = new System.IO.FileInfo(baseDir.FullName + "\\" + p.Replace(StringHelper.Dot, System.IO.Path.DirectorySeparatorChar)); // if the directory exists, make sure it is a directory bool tmpBool; ! if (System.IO.File.Exists(dir.FullName)) tmpBool = true; else ! tmpBool = System.IO.Directory.Exists(dir.FullName); if (tmpBool) { ! if (!System.IO.Directory.Exists(dir.FullName)) { ! throw new System.Exception("The path: " + dir.FullName + " exists, but is not a directory"); } } ! // else make the directory and any non-existent parent directories else { ! if (!System.IO.Directory.CreateDirectory(dir.FullName).Exists) { ! throw new System.Exception("unable to create directory: " + dir.FullName); } } --- 197,228 ---- } /// <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)); // if the directory exists, make sure it is a directory bool tmpBool; ! if (File.Exists(dir.FullName)) tmpBool = true; else ! tmpBool = Directory.Exists(dir.FullName); if (tmpBool) { ! if (!Directory.Exists(dir.FullName)) { ! throw new Exception("The path: " + dir.FullName + " exists, but is not a directory"); } } ! // else make the directory and any non-existent parent directories else { ! if (!Directory.CreateDirectory(dir.FullName).Exists) { ! throw new Exception("unable to create directory: " + dir.FullName); } } Index: MappingElement.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/MappingElement.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MappingElement.cs 25 Jul 2004 11:41:03 -0000 1.1 --- MappingElement.cs 13 Sep 2004 12:55:24 -0000 1.2 *************** *** 71,75 **** /// <summary>Returns true if this element has the meta attribute </summary> ! public virtual bool hasMeta(System.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(System.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]; *************** *** 85,93 **** /// /// </summary> - /// <param name="">string - /// </param> /// <returns> String /// </returns> ! public virtual System.String getMetaAsString(System.String attribute) { SupportClass.ListCollectionSupport c = getMeta(attribute); --- 85,91 ---- /// /// </summary> /// <returns> String /// </returns> ! public virtual String getMetaAsString(String attribute) { SupportClass.ListCollectionSupport c = getMeta(attribute); *************** *** 96,110 **** } ! public virtual System.String getMetaAsString(System.String attribute, System.String seperator) { return MetaAttributeHelper.getMetaAsString(getMeta(attribute), seperator); } ! public virtual bool getMetaAsBool(System.String attribute) { return getMetaAsBool(attribute, false); } ! public virtual bool getMetaAsBool(System.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/nhibernate/src/NHibernate.Tool.hbm2net/MethodSignatureBuilder.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MethodSignatureBuilder.cs 25 Jul 2004 11:41:03 -0000 1.1 --- MethodSignatureBuilder.cs 13 Sep 2004 12:55:25 -0000 1.2 *************** *** 1,3 **** --- 1,6 ---- using System; + using System.Collections; + using System.Text; + namespace NHibernate.Tool.hbm2net { *************** *** 14,22 **** { //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! paramList = new System.Collections.ArrayList(); //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! throwsList = new System.Collections.ArrayList(); } ! virtual public System.String Name { get --- 17,25 ---- { //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! paramList = new ArrayList(); //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! throwsList = new ArrayList(); } ! virtual public String Name { get *************** *** 31,35 **** } ! virtual public System.String ReturnType { get --- 34,38 ---- } ! virtual public String ReturnType { get *************** *** 44,48 **** } ! virtual public System.String AccessModifier { get --- 47,51 ---- } ! virtual public String AccessModifier { get *************** *** 58,62 **** } //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! virtual public System.Collections.ArrayList ParamList { get --- 61,65 ---- } //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' ! virtual public ArrayList ParamList { get *************** *** 72,86 **** } ! private System.String name = ""; ! private System.String returnType = ""; ! private System.String accessModifier = ""; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'paramList' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private System.Collections.ArrayList paramList; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'throwsList' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private System.Collections.ArrayList throwsList; ! public MethodSignatureBuilder(System.String methodName, System.String returnType, System.String accessModifier) { InitBlock(); --- 75,89 ---- } ! private String name = ""; ! private String returnType = ""; ! private String accessModifier = ""; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'paramList' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private ArrayList paramList; //UPGRADE_ISSUE: Class hierarchy differences between 'java.util.ArrayList' and 'System.Collections.ArrayList' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186"' //UPGRADE_NOTE: The initialization of 'throwsList' was moved to method 'InitBlock'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! private ArrayList throwsList; ! public MethodSignatureBuilder(String methodName, String returnType, String accessModifier) { InitBlock(); *************** *** 90,101 **** } ! public virtual System.String buildMethodSignature() { ! System.Text.StringBuilder sb = new System.Text.StringBuilder(accessModifier + " " + returnType + " " + name + "("); //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"' for (int i = 0; i < paramList.Count; i++) { ! System.String param = (System.String) paramList[i]; sb.Append(param); --- 93,104 ---- } ! public virtual String buildMethodSignature() { ! StringBuilder sb = new StringBuilder(accessModifier + " " + returnType + " " + name + "("); //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"' for (int i = 0; i < paramList.Count; i++) { ! String param = (String) paramList[i]; sb.Append(param); *************** *** 115,119 **** sb.Append(" throws "); } ! System.String thr = (System.String) throwsList[i]; sb.Append(thr); --- 118,122 ---- sb.Append(" throws "); } ! String thr = (String) throwsList[i]; sb.Append(thr); *************** *** 129,133 **** } ! public virtual void addParam(System.String param) { //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"' --- 132,136 ---- } ! public virtual void addParam(String param) { //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"' *************** *** 135,139 **** } ! public virtual void addThrows(System.String throwsString) { //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"' --- 138,142 ---- } ! public virtual void addThrows(String throwsString) { //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"' Index: MetaAttributeHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/MetaAttributeHelper.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MetaAttributeHelper.cs 25 Jul 2004 11:41:03 -0000 1.1 --- MetaAttributeHelper.cs 13 Sep 2004 12:55:25 -0000 1.2 *************** *** 1,4 **** using System; ! using StringHelper = NHibernate.Util.StringHelper; using MultiHashMap = System.Collections.Hashtable; using MultiMap = System.Collections.Hashtable; --- 1,5 ---- using System; ! using System.Collections; ! using System.Text; using MultiHashMap = System.Collections.Hashtable; using MultiMap = System.Collections.Hashtable; *************** *** 20,27 **** internal class MetaAttribute { ! internal System.String value_Renamed; internal bool inheritable = true; ! internal MetaAttribute(System.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; *************** *** 29,33 **** } ! public override System.String ToString() { return value_Renamed; --- 30,34 ---- } ! public override String ToString() { return value_Renamed; *************** *** 38,43 **** /// /// </summary> - /// <param name="">element - /// </param> /// <returns> MultiMap /// </returns> --- 39,42 ---- *************** *** 49,65 **** metaAttributeList.AddAll(element.SelectNodes("urn:meta", CodeGenerator.nsmgr)); ! for (System.Collections.IEnumerator iter = metaAttributeList.GetEnumerator(); iter.MoveNext(); ) { 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. ! System.String attribute = (metaAttrib.Attributes["attribute"] == null?string.Empty:metaAttrib.Attributes["attribute"].Value); ! System.String value_Renamed = metaAttrib.InnerText; ! System.String inheritStr = (metaAttrib.Attributes["inherit"] == null?null:metaAttrib.Attributes["inherit"].Value); bool inherit = true; ! if ((System.Object) inheritStr != null) { try { ! inherit = System.Boolean.Parse(inheritStr); } catch{} --- 48,64 ---- metaAttributeList.AddAll(element.SelectNodes("urn:meta", CodeGenerator.nsmgr)); ! for (IEnumerator iter = metaAttributeList.GetEnumerator(); iter.MoveNext(); ) { 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) { try { ! inherit = Boolean.Parse(inheritStr); } catch{} *************** *** 79,86 **** /// /// </summary> - /// <param name="">local - /// </param> - /// <param name="">inherited - /// </param> /// <returns> a MultiMap with all values from local and extra values /// from inherited --- 78,81 ---- *************** *** 93,105 **** if (inherited != null) { ! for (System.Collections.IEnumerator iter = new SupportClass.SetSupport(inherited.Keys).GetEnumerator(); iter.MoveNext(); ) { ! System.String key = (System.String) iter.Current; if (!local.ContainsKey(key)) { // inheriting a meta attribute only if it is inheritable ! System.Collections.ArrayList ml = (System.Collections.ArrayList) inherited[key]; ! for (System.Collections.IEnumerator iterator = ml.GetEnumerator(); iterator.MoveNext(); ) { MetaAttribute element = (MetaAttribute) iterator.Current; --- 88,100 ---- if (inherited != null) { ! for (IEnumerator iter = new SupportClass.SetSupport(inherited.Keys).GetEnumerator(); iter.MoveNext(); ) { ! String key = (String) iter.Current; if (!local.ContainsKey(key)) { // inheriting a meta attribute only if it is inheritable ! ArrayList ml = (ArrayList) inherited[key]; ! for (IEnumerator iterator = ml.GetEnumerator(); iterator.MoveNext(); ) { MetaAttribute element = (MetaAttribute) iterator.Current; *************** *** 119,126 **** } /// <summary> Method loadAndMergeMetaMap.</summary> - /// <param name="">classElement - /// </param> - /// <param name="">inheritedMeta - /// </param> /// <returns> MultiMap /// </returns> --- 114,117 ---- *************** *** 130,142 **** } ! /// <param name="">collection ! /// </param> ! /// <param name="">string ! /// </param> ! public static System.String getMetaAsString(SupportClass.ListCollectionSupport meta, System.String seperator) { ! System.Text.StringBuilder buf = new System.Text.StringBuilder(); bool first = true; ! for (System.Collections.IEnumerator iter = meta.GetEnumerator(); iter.MoveNext(); ) { if (first) --- 121,129 ---- } ! public static String getMetaAsString(SupportClass.ListCollectionSupport meta, String seperator) { ! StringBuilder buf = new StringBuilder(); bool first = true; ! for (IEnumerator iter = meta.GetEnumerator(); iter.MoveNext(); ) { if (first) *************** *** 168,172 **** } ! internal static System.String getMetaAsString(SupportClass.ListCollectionSupport c) { if (c == null || c.IsEmpty()) --- 155,159 ---- } ! internal static String getMetaAsString(SupportClass.ListCollectionSupport c) { if (c == null || c.IsEmpty()) *************** *** 176,183 **** else { ! System.Text.StringBuilder sb = new System.Text.StringBuilder(); ! for (System.Collections.IEnumerator iter = c.GetEnumerator(); iter.MoveNext(); ) { ! System.Object element = iter.Current; sb.Append(element.ToString()); } --- 163,170 ---- else { ! StringBuilder sb = new StringBuilder(); ! for (IEnumerator iter = c.GetEnumerator(); iter.MoveNext(); ) { ! Object element = iter.Current; sb.Append(element.ToString()); } Index: FinderRenderer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/FinderRenderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FinderRenderer.cs 25 Jul 2004 11:41:03 -0000 1.1 --- FinderRenderer.cs 13 Sep 2004 12:55:24 -0000 1.2 *************** *** 1,3 **** --- 1,7 ---- using System; + using System.Collections; + using System.IO; + using System.Reflection; + using log4net; namespace NHibernate.Tool.hbm2net *************** *** 59,63 **** public class FinderRenderer:AbstractRenderer { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public FinderRenderer() --- 63,67 ---- public class FinderRenderer:AbstractRenderer { ! private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public FinderRenderer() *************** *** 70,105 **** tempObject = "Character"; primitiveToObject["char"] = tempObject; - System.Object generatedAux = tempObject; object tempObject2; tempObject2 = "Byte"; primitiveToObject["byte"] = tempObject2; ! System.Object generatedAux2 = tempObject2; object tempObject3; tempObject3 = "Short"; primitiveToObject["short"] = tempObject3; ! System.Object generatedAux3 = tempObject3; object tempObject4; tempObject4 = "Integer"; primitiveToObject["int"] = tempObject4; ! System.Object generatedAux4 = tempObject4; object tempObject5; tempObject5 = "Long"; primitiveToObject["long"] = tempObject5; ! System.Object generatedAux5 = tempObject5; ! object tempObject6; tempObject6 = "Boolean"; primitiveToObject["boolean"] = tempObject6; - System.Object generatedAux6 = tempObject6; object tempObject7; tempObject7 = "Float"; primitiveToObject["float"] = tempObject7; ! System.Object generatedAux7 = tempObject7; object tempObject8; tempObject8 = "Double"; primitiveToObject["double"] = tempObject8; - System.Object generatedAux8 = tempObject8; hibType["char"] = "Hibernate.CHARACTER"; --- 74,105 ---- tempObject = "Character"; primitiveToObject["char"] = tempObject; object tempObject2; tempObject2 = "Byte"; primitiveToObject["byte"] = tempObject2; ! object tempObject3; tempObject3 = "Short"; primitiveToObject["short"] = tempObject3; ! object tempObject4; tempObject4 = "Integer"; primitiveToObject["int"] = tempObject4; ! object tempObject5; tempObject5 = "Long"; primitiveToObject["long"] = tempObject5; ! object tempObject6; tempObject6 = "Boolean"; primitiveToObject["boolean"] = tempObject6; object tempObject7; tempObject7 = "Float"; primitiveToObject["float"] = tempObject7; ! object tempObject8; tempObject8 = "Double"; primitiveToObject["double"] = tempObject8; hibType["char"] = "Hibernate.CHARACTER"; *************** *** 123,143 **** tempObject9 = "Hibernate.DOUBLE"; hibType["double"] = tempObject9; - System.Object generatedAux9 = tempObject9; object tempObject10; tempObject10 = "Hibernate.STRING"; hibType["String"] = tempObject10; - System.Object generatedAux10 = tempObject10; object tempObject11; tempObject11 = "Hibernate.LOCALE"; hibType["Locale"] = tempObject11; - System.Object generatedAux11 = tempObject11; } ! private const System.String MT_FINDERMETHOD = "finder-method"; ! private const System.String MT_FOREIGNFINDERMETHOD = "foreign-finder-name"; ! private const System.String MT_FOREIGNFINDERFIELD = "foreign-finder-field"; ! private const System.String MT_FOREIGNJOINFIELD = "foreign-join-field"; --- 123,140 ---- tempObject9 = "Hibernate.DOUBLE"; hibType["double"] = tempObject9; object tempObject10; tempObject10 = "Hibernate.STRING"; hibType["String"] = tempObject10; object tempObject11; tempObject11 = "Hibernate.LOCALE"; hibType["Locale"] = tempObject11; } ! 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"; *************** *** 145,157 **** /// <summary> Render finder classes.</summary> - /// <param name="">classMapping - /// </param> - /// <param name="">class2classmap - /// </param> - /// <param name="">mainwriter - /// </param> /// <exception cref=""> Exception /// </exception> ! public override void render(System.String savedToPackage, System.String savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StreamWriter mainwriter) { --- 142,148 ---- /// <summary> Render finder classes.</summary> /// <exception cref=""> Exception /// </exception> ! public override void render(String savedToPackage, String savedToClass, ClassMapping classMapping, IDictionary class2classmap, StreamWriter mainwriter) { *************** *** 161,169 **** // switch to another writer to be able to insert the actually // used imports when whole class has been rendered. ! System.IO.StringWriter writer = new System.IO.StringWriter(); writer.WriteLine("/** Automatically generated Finder class for " + savedToClass + ".\n" + " * @author Hibernate FinderGenerator " + " **/"); ! System.String classScope = "public"; writer.Write(classScope + " class " + savedToClass); --- 152,160 ---- // switch to another writer to be able to insert the actually // used imports when whole class has been rendered. ! StringWriter writer = new StringWriter(); writer.WriteLine("/** Automatically generated Finder class for " + savedToClass + ".\n" + " * @author Hibernate FinderGenerator " + " **/"); ! String classScope = "public"; writer.Write(classScope + " class " + savedToClass); *************** *** 176,180 **** // switch to another writer to be able to insert the // veto- and changeSupport fields ! System.IO.StringWriter propWriter = new System.IO.StringWriter(); doFinders(classMapping, class2classmap, propWriter); --- 167,171 ---- // switch to another writer to be able to insert the // veto- and changeSupport fields ! StringWriter propWriter = new StringWriter(); doFinders(classMapping, class2classmap, propWriter); *************** *** 194,211 **** /// /// </summary> ! /// <param name="">classMapping ! /// </param> ! /// <param name="">class2classmap ! /// </param> ! /// <param name="">writer ! /// </param> ! public virtual void doFinders(ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer) { // Find out of there is a system wide way to get sessions defined ! System.String sessionMethod = classMapping.getMetaAsString("session-method").Trim(); // fields //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilIteratorhasNext"' ! for (System.Collections.IEnumerator fields = classMapping.Fields.GetEnumerator(); fields.MoveNext(); ) { //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilIteratornext"' --- 185,196 ---- /// /// </summary> ! public virtual void doFinders(ClassMapping classMapping, IDictionary class2classmap, StringWriter writer) { // Find out of there is a system wide way to get sessions defined ! String sessionMethod = classMapping.getMetaAsString("session-method").Trim(); // fields //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilIteratorhasNext"' ! for (IEnumerator fields = classMapping.Fields.GetEnumerator(); fields.MoveNext(); ) { //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilIteratornext"' *************** *** 215,219 **** { ! System.String finderName = field.getMetaAsString(MT_FINDERMETHOD); if ("".Equals(sessionMethod)) --- 200,204 ---- { ! String finderName = field.getMetaAsString(MT_FINDERMETHOD); if ("".Equals(sessionMethod)) *************** *** 236,242 **** else if (field.getMeta(MT_FOREIGNFINDERMETHOD) != null) { ! System.String finderName = field.getMetaAsString(MT_FOREIGNFINDERMETHOD); ! System.String fieldName = field.getMetaAsString(MT_FOREIGNFINDERFIELD); ! System.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 *************** *** 254,258 **** FieldProperty foreignField = null; //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilIteratorhasNext"' ! for (System.Collections.IEnumerator foreignFields = foreignClass.Fields.GetEnumerator(); foreignFields.MoveNext(); ) { //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilIteratornext"' --- 239,243 ---- FieldProperty foreignField = null; //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilIteratorhasNext"' ! for (IEnumerator foreignFields = foreignClass.Fields.GetEnumerator(); foreignFields.MoveNext(); ) { //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilIteratornext"' *************** *** 334,338 **** //UPGRADE_TODO: Class 'java.util.HashMap' was converted to 'System.Collections.Hashtable' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilHashMap"' //UPGRADE_NOTE: The initialization of 'primitiveToObject' was moved to static method 'NHibernate.Tool.hbm2net.FinderRenderer'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! internal static System.Collections.IDictionary primitiveToObject; --- 319,323 ---- //UPGRADE_TODO: Class 'java.util.HashMap' was converted to 'System.Collections.Hashtable' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilHashMap"' //UPGRADE_NOTE: The initialization of 'primitiveToObject' was moved to static method 'NHibernate.Tool.hbm2net.FinderRenderer'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! internal static IDictionary primitiveToObject; *************** *** 340,348 **** /// /// </summary> ! /// <param name="">classMapping ! /// </param> ! /// <param name="">writer ! /// </param> ! public virtual void doImports(ClassMapping classMapping, System.IO.StreamWriter writer) { // imports is not included from the class it self as this is a separate generated class. --- 325,329 ---- /// /// </summary> ! public virtual void doImports(ClassMapping classMapping, StreamWriter writer) { // imports is not included from the class it self as this is a separate generated class. *************** *** 370,380 **** /// /// </summary> - /// <param name="">prependThis - /// </param> - /// <param name="">field - /// </param> /// <returns> /// </returns> ! public static System.String getFieldAsObject(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; --- 351,357 ---- /// /// </summary> /// <returns> /// </returns> ! public static String getFieldAsObject(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; *************** *** 382,386 **** { //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"' ! System.String typeName = (System.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.":""); *************** *** 396,400 **** //UPGRADE_TODO: Class 'java.util.HashMap' was converted to 'System.Collections.Hashtable' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilHashMap"' //UPGRADE_NOTE: The initialization of 'hibType' was moved to static method 'NHibernate.Tool.hbm2net.FinderRenderer'. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1005"' ! internal static System.Collections.IDictionary hibType; --- 373,377 ---- //UPGRADE_TODO: Class 'java.util.HashMap' was converted to 'System.Collections.Hashtable' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilHashMap"' //UPGRADE_NOTE: The initialization of 'hibType' was moved to static method 'NHibernate.Tool.hbm2net.FinderRenderer'. 'ms-help://MS.VSCC.2003/commoner/redi... [truncated message content] |