You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(248) |
May
(82) |
Jun
(90) |
Jul
(177) |
Aug
(253) |
Sep
(157) |
Oct
(151) |
Nov
(143) |
Dec
(278) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(152) |
Feb
(107) |
Mar
(177) |
Apr
(133) |
May
(259) |
Jun
(81) |
Jul
(119) |
Aug
(306) |
Sep
(416) |
Oct
(240) |
Nov
(329) |
Dec
(206) |
2006 |
Jan
(466) |
Feb
(382) |
Mar
(153) |
Apr
(162) |
May
(133) |
Jun
(21) |
Jul
(18) |
Aug
(37) |
Sep
(97) |
Oct
(114) |
Nov
(110) |
Dec
(28) |
2007 |
Jan
(74) |
Feb
(65) |
Mar
(49) |
Apr
(76) |
May
(43) |
Jun
(15) |
Jul
(68) |
Aug
(55) |
Sep
(63) |
Oct
(59) |
Nov
(70) |
Dec
(66) |
2008 |
Jan
(71) |
Feb
(60) |
Mar
(120) |
Apr
(31) |
May
(48) |
Jun
(81) |
Jul
(107) |
Aug
(51) |
Sep
(80) |
Oct
(83) |
Nov
(83) |
Dec
(79) |
2009 |
Jan
(83) |
Feb
(110) |
Mar
(97) |
Apr
(91) |
May
(291) |
Jun
(250) |
Jul
(197) |
Aug
(58) |
Sep
(54) |
Oct
(122) |
Nov
(68) |
Dec
(34) |
2010 |
Jan
(50) |
Feb
(17) |
Mar
(63) |
Apr
(61) |
May
(84) |
Jun
(81) |
Jul
(138) |
Aug
(144) |
Sep
(78) |
Oct
(26) |
Nov
(30) |
Dec
(61) |
2011 |
Jan
(33) |
Feb
(35) |
Mar
(166) |
Apr
(221) |
May
(109) |
Jun
(76) |
Jul
(27) |
Aug
(37) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(1) |
2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael D. <mik...@us...> - 2004-09-14 17:50:05
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11256/Loader Modified Files: Loader.cs Log Message: Major refactoring with NDataReader and Batcher. NHibernate now uses an IDataReader returned from the Driver for as long as possible before converting to a NDataReader. This has nice perf gains on the simple performance test in the Test Fixtures. Index: Loader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/Loader.cs,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Loader.cs 2 Sep 2004 15:13:35 -0000 1.34 --- Loader.cs 14 Sep 2004 17:49:56 -0000 1.35 *************** *** 674,693 **** { log.Info(st.CommandText); ! //TODO: H2.0.3 - uses session.Batcher.GetResultSet(st) instead ! // of directly executing the reader - the Batcher can be smarter ! // about when to wrap the IDataReader in an NDataReader ! rs = st.ExecuteReader(); ! ! //TODO: make this a much smarter implementation that looks at the Type ! // that is being loaded and determines wether or not to wrap this IDataReader ! // in a NDataReader. I believe the problem of multiple readers being opened ! // are occuring in <composite-id> with <many-to-one> and <component> with ! // a <collection>, <many-to-one>, and <one-to-one> inside of them. I believe ! // this is caused when the NullSafeGet() method calls other methods that can ! // potentially perform a Load of another object. ! if(!session.Factory.ConnectionProvider.Driver.SupportsMultipleOpenReaders) ! { ! rs = new Driver.NDataReader(rs); ! } if( !UseLimit(selection, session.Factory.Dialect) ) --- 674,678 ---- { log.Info(st.CommandText); ! rs = session.Batcher.ExecuteReader( st ); if( !UseLimit(selection, session.Factory.Dialect) ) |
From: Michael D. <mik...@us...> - 2004-09-14 17:50:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11256/Id Modified Files: SequenceGenerator.cs Log Message: Major refactoring with NDataReader and Batcher. NHibernate now uses an IDataReader returned from the Driver for as long as possible before converting to a NDataReader. This has nice perf gains on the simple performance test in the Test Fixtures. Index: SequenceGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/SequenceGenerator.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SequenceGenerator.cs 28 Aug 2004 04:24:20 -0000 1.4 --- SequenceGenerator.cs 14 Sep 2004 17:49:54 -0000 1.5 *************** *** 42,59 **** public virtual object Generate(ISessionImplementor session, object obj) { ! IDbCommand st = session.Batcher.PrepareCommand( new SqlString(sql) ); try { ! IDataReader rs = st.ExecuteReader(); object result = null; ! try ! { ! rs.Read(); ! result = IdentifierGeneratorFactory.Get(rs, returnClass); ! } ! finally ! { ! rs.Close(); ! } log.Debug("sequence ID generated: " + result); --- 42,53 ---- public virtual object Generate(ISessionImplementor session, object obj) { ! IDbCommand cmd = session.Batcher.PrepareCommand( new SqlString(sql) ); ! IDataReader reader = null; try { ! reader = session.Batcher.ExecuteReader( cmd ); object result = null; ! reader.Read(); ! result = IdentifierGeneratorFactory.Get(reader, returnClass); log.Debug("sequence ID generated: " + result); *************** *** 66,70 **** finally { ! session.Batcher.CloseCommand(st); } } --- 60,64 ---- finally { ! session.Batcher.CloseCommand( cmd, reader); } } |
From: Michael D. <mik...@us...> - 2004-09-14 17:50:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11256/Engine Modified Files: IBatcher.cs ISessionImplementor.cs Removed Files: IPreparer.cs Log Message: Major refactoring with NDataReader and Batcher. NHibernate now uses an IDataReader returned from the Driver for as long as possible before converting to a NDataReader. This has nice perf gains on the simple performance test in the Test Fixtures. --- IPreparer.cs DELETED --- Index: ISessionImplementor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ISessionImplementor.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ISessionImplementor.cs 14 Jul 2004 21:22:16 -0000 1.20 --- ISessionImplementor.cs 14 Sep 2004 17:49:54 -0000 1.21 *************** *** 159,169 **** /// <summary> - /// Get the NHibernate Command Preparer for this Session. - /// new to NH - /// </summary> - IPreparer Preparer {get; } - //TODO: this will eventually replace the Batcher... - - /// <summary> /// After actually inserting a row, record the fact taht the instance exists on the database /// (needed for identity-column key generation) --- 159,162 ---- Index: IBatcher.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/IBatcher.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IBatcher.cs 28 Aug 2004 04:18:40 -0000 1.3 --- IBatcher.cs 14 Sep 2004 17:49:54 -0000 1.4 *************** *** 7,11 **** { /// <summary> ! /// Manages <c>IDbCommand</c>s for a session. /// </summary> /// <remarks> --- 7,11 ---- { /// <summary> ! /// Manages <see cref="IDbCommand">IDbCommands</see> and <see cref="IDataReader">IDataReaders</see> for a session. /// </summary> /// <remarks> *************** *** 37,50 **** IDbCommand PrepareQueryCommand(SqlString sql, bool scrollable); - // TODO: how applicable is this???? /// <summary> ! /// Closes a command opened with <c>PrepareQueryStatement</c> /// </summary> ! /// <param name="cmd"></param> ! /// <param name="reader"></param> ! /// <remarks> ! /// TODO: Not sure this is needed - with jdbc you can close a statement - does this ! /// have an equivalent of Disposing and IDbCommand??? ! /// </remarks> void CloseQueryCommand(IDbCommand cmd, IDataReader reader); --- 37,46 ---- IDbCommand PrepareQueryCommand(SqlString sql, bool scrollable); /// <summary> ! /// Closes the <see cref="IDbCommand"/> & the <see cref="IDataReader"/> that was ! /// opened with <c>PrepareQueryCommand</c>. /// </summary> ! /// <param name="cmd">The <see cref="IDbCommand"/> to close.</param> ! /// <param name="reader">The <see cref="IDataReader"/> to close.</param> void CloseQueryCommand(IDbCommand cmd, IDataReader reader); *************** *** 57,66 **** IDbCommand PrepareCommand(SqlString sql); - //TODO: how applicable is this??? /// <summary> /// Close a IDbCommand opened using <c>PrepareStatement()</c> /// </summary> ! /// <param name="cm"></param> ! void CloseCommand(IDbCommand cm); /// <summary> --- 53,62 ---- IDbCommand PrepareCommand(SqlString sql); /// <summary> /// Close a IDbCommand opened using <c>PrepareStatement()</c> /// </summary> ! /// <param name="cm">The <see cref="IDbCommand"/> to ensure is closed.</param> ! /// <param name="reader">The <see cref="IDataReader"/> to ensure is closed.</param> ! void CloseCommand(IDbCommand cm, IDataReader reader); /// <summary> *************** *** 98,102 **** void CloseCommands(); ! IDataReader GetDataReader(IDbCommand cmd); /// <summary> --- 94,117 ---- void CloseCommands(); ! /// <summary> ! /// Gets an <see cref="IDataReader"/> by calling ExecuteReader on the <see cref="IDbCommand"/>. ! /// </summary> ! /// <param name="cmd">The <see cref="IDbCommand"/> to execute to get the <see cref="IDataReader"/>.</param> ! /// <returns>The <see cref="IDataReader"/> from the <see cref="IDbCommand"/>.</returns> ! /// <remarks> ! /// The Batcher is responsible for ensuring that all of the Drivers rules for how many open ! /// <see cref="IDataReader"/>s it can have are followed. ! /// </remarks> ! IDataReader ExecuteReader(IDbCommand cmd); ! ! /// <summary> ! /// Executes the <see cref="IDbCommand"/>. ! /// </summary> ! /// <param name="cmd">The <see cref="IDbCommand"/> to execute.</param> ! /// <returns>The number of rows affected.</returns> ! /// <remarks> ! /// The Batcher is responsible for ensuring that all of the Drivers rules for how many open ! /// <see cref="IDataReader"/>s it can have are followed. ! int ExecuteNonQuery(IDbCommand cmd); /// <summary> *************** *** 106,109 **** --- 121,134 ---- void AbortBatch(Exception e); + /// <summary> + /// Generates an <see cref="IDbCommand"/> from a <see cref="SqlString"/>. + /// </summary> + /// <param name="sqlString">The <see cref="SqlString"/> to use to generate an <see cref="IDbCommand"/>.</param> + /// <returns>An <see cref="IDbCommand"/> that is not attached to a Connection or Transaction.</returns> + /// <remarks> + /// A wrapper for calling the <c>IDriver.GenerateCommand</c> that adds logging. + /// </remarks> + IDbCommand Generate(SqlString sqlString); + } } |
From: Michael D. <mik...@us...> - 2004-09-13 23:15:37
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17774 Added Files: NHibernate.build Log Message: Renamed it to NHibernate.build to help with building on mono --- NEW FILE: NHibernate.build --- <?xml version="1.0" ?> <project name="NHibernate" default="build" xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" > <!-- Required properties: * build.dir - (path) root level to build to, assemblies will go in ${build.dir}/bin * build.debug - (true|false) debug build? * current.build.defines - framework-specific build defines * project.version - full project version * project.version.major - the major number of the build * project.version.minor - the minor number of the build * project.version.build - the build number * sign - indicates if the Assembly should be signed --> <property name="keyFile" value="..\NHibernate.snk" /> <target name="build" description="Build NHibernate"> <!-- ensure the AssemblyInfo is writable --> <attrib file="AssemblyInfo.cs" readonly="false" /> <asminfo output="AssemblyInfo.cs" language="CSharp"> <imports> <import name="System.Reflection" /> <import name="System.Runtime.CompilerServices" /> </imports> <attributes> <attribute type="AssemblyTitleAttribute" value="${nant.project.name} for ${current.runtime.description}" /> <attribute type="AssemblyDescriptionAttribute" value="An object persistence library for relational databases." /> <attribute type="AssemblyCompanyAttribute" value="nhibernate.sourceforge.net" /> <attribute type="AssemblyProductAttribute" value="${nant.project.name}" /> <attribute type="AssemblyCopyrightAttribute" value="Licensed under LGPL." /> <attribute type="AssemblyVersionAttribute" value="${project.version}" /> <attribute type="AssemblyInformationalVersionAttribute" value="${project.version.major}.${project.version.minor}" /> <attribute type="AssemblyFileVersionAttribute" value="${project.version}" /> <attribute type="AssemblyKeyFileAttribute" value="${keyFile}" if="${sign}"/> </attributes> </asminfo> <csc target="library" define="${current.build.defines}" debug="${build.debug}" output="${build.dir}/bin/${nant.project.name}.dll" doc="${build.dir}/bin/${nant.project.name}.xml" > <sources failonempty="true"> <includes name="**/*.cs" /> <excludes name="Eg/**" /> <excludes name="InternalTest/**/*.cs" /> <excludes name="Test/**/*.cs" /> <excludes name="Util/*Test.cs" /> <excludes name="Dialect/DB2Dialect.cs" /> <excludes name="Dialect/HSQLDialect.cs" /> <excludes name="Dialect/InterbaseDialect.cs" /> <excludes name="Dialect/SAPDBDialect.cs" /> <excludes name="Tool/hbm2net/*.cs" /> </sources> <resources prefix="NHibernate" dynamicprefix="true"> <includes name="*.xsd" /> <includes name="**/*.xml" /> <excludes name="bin/**/*.xml" /> </resources> <references basedir="${build.dir}/bin"> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> <includes name="log4net.dll" /> <includes name="HashCodeProvider.dll" /> </references> </csc> </target> </project> |
From: Michael D. <mik...@us...> - 2004-09-13 23:14:45
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17528 Removed Files: nhibernate.build Log Message: Going to rename it to NHibernate.build --- nhibernate.build DELETED --- |
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] |
From: Peter S. <sz...@us...> - 2004-09-13 12:48:12
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12414 Modified Files: AbstractRenderer.cs AssemblyInfo.cs BasicRenderer.cs ClassMapping.cs ClassName.cs CodeGenerator.cs DOMRenderer.cs FieldProperty.cs Log Message: Reordered the code a bit Index: CodeGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/CodeGenerator.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CodeGenerator.cs 25 Jul 2004 11:49:39 -0000 1.2 --- CodeGenerator.cs 13 Sep 2004 12:47:59 -0000 1.3 *************** *** 1,5 **** using System; ! using MappingException = NHibernate.MappingException; ! using MultiHashMap = System.Collections.Hashtable; using MultiMap = System.Collections.Hashtable; --- 1,9 ---- using System; ! using System.Collections; ! using System.IO; ! using System.Reflection; ! using System.Xml; ! using log4net; ! using log4net.Config; using MultiHashMap = System.Collections.Hashtable; using MultiMap = System.Collections.Hashtable; *************** *** 14,40 **** public class CodeGenerator { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); ! internal static System.Xml.XmlNamespaceManager nsmgr; [STAThread] ! public static void Main(System.String[] args) { ! nsmgr = new System.Xml.XmlNamespaceManager(new System.Xml.NameTable()); nsmgr.AddNamespace("urn", "urn:nhibernate-mapping-2.0"); ! System.IO.File.Delete("error-log.txt"); ! log4net.Config.DOMConfigurator.Configure(new System.IO.FileInfo("NHibernate.Tool.hbm2net.exe.config")); if (args.Length == 0) { ! System.Console.Error.WriteLine("No arguments provided. Nothing to do. Exit."); ! System.Environment.Exit(- 1); } try { ! System.Collections.ArrayList mappingFiles = new System.Collections.ArrayList(); ! System.String outputDir = null; SupportClass.ListCollectionSupport generators = new SupportClass.ListCollectionSupport(); --- 18,44 ---- public class CodeGenerator { ! private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); ! internal static XmlNamespaceManager nsmgr; [STAThread] ! public static void Main(String[] args) { ! nsmgr = new XmlNamespaceManager(new NameTable()); nsmgr.AddNamespace("urn", "urn:nhibernate-mapping-2.0"); ! File.Delete("error-log.txt"); ! DOMConfigurator.Configure(new FileInfo("NHibernate.Tool.hbm2net.exe.config")); if (args.Length == 0) { ! Console.Error.WriteLine("No arguments provided. Nothing to do. Exit."); ! Environment.Exit(- 1); } try { ! ArrayList mappingFiles = new ArrayList(); ! String outputDir = null; SupportClass.ListCollectionSupport generators = new SupportClass.ListCollectionSupport(); *************** *** 50,57 **** { // parse config xml file ! Document document = new System.Xml.XmlDocument(); document.Load(args[i].Substring(9)); ! globalMetas = MetaAttributeHelper.loadAndMergeMetaMap((System.Xml.XmlElement)(document["codegen"]), null); ! System.Collections.IEnumerator generateElements = document["codegen"].SelectNodes("generate").GetEnumerator(); while (generateElements.MoveNext()) --- 54,61 ---- { // parse config xml file ! Document document = new XmlDocument(); document.Load(args[i].Substring(9)); ! globalMetas = MetaAttributeHelper.loadAndMergeMetaMap((document["codegen"]), null); ! IEnumerator generateElements = document["codegen"].SelectNodes("generate").GetEnumerator(); while (generateElements.MoveNext()) *************** *** 77,82 **** } ! System.Collections.Hashtable classMappings = new System.Collections.Hashtable(); ! for (System.Collections.IEnumerator iter = mappingFiles.GetEnumerator(); iter.MoveNext(); ) { try --- 81,86 ---- } ! Hashtable classMappings = new Hashtable(); ! for (IEnumerator iter = mappingFiles.GetEnumerator(); iter.MoveNext(); ) { try *************** *** 84,91 **** log.Info(iter.Current.ToString()); // parse the mapping file ! System.Xml.NameTable nt = new System.Xml.NameTable(); nt.Add("urn:nhibernate-mapping-2.0"); ! Document document = new System.Xml.XmlDocument(nt); ! document.Load((System.String) iter.Current); Element rootElement = document["hibernate-mapping"]; --- 88,95 ---- log.Info(iter.Current.ToString()); // parse the mapping file ! NameTable nt = new NameTable(); nt.Add("urn:nhibernate-mapping-2.0"); ! Document document = new XmlDocument(nt); ! document.Load((String) iter.Current); Element rootElement = document["hibernate-mapping"]; *************** *** 94,99 **** continue; ! System.Xml.XmlAttribute a = rootElement.Attributes["package"]; ! System.String pkg = null; if (a != null) { --- 98,103 ---- continue; ! XmlAttribute a = rootElement.Attributes["package"]; ! String pkg = null; if (a != null) { *************** *** 101,105 **** } MappingElement me = new MappingElement(rootElement, null); ! System.Collections.IEnumerator classElements = rootElement.SelectNodes("urn:class", nsmgr).GetEnumerator(); MultiMap mm = MetaAttributeHelper.loadAndMergeMetaMap(rootElement, globalMetas); handleClass(pkg, me, classMappings, classElements, mm, false); --- 105,109 ---- } 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); *************** *** 117,121 **** } // generate source files ! for (System.Collections.IEnumerator iterator = generators.GetEnumerator(); iterator.MoveNext(); ) { Generator g = (Generator) iterator.Current; --- 121,125 ---- } // generate source files ! for (IEnumerator iterator = generators.GetEnumerator(); iterator.MoveNext(); ) { Generator g = (Generator) iterator.Current; *************** *** 124,128 **** } } ! catch (System.Exception e) { SupportClass.WriteStackTrace(e, Console.Error); --- 128,132 ---- } } ! catch (Exception e) { SupportClass.WriteStackTrace(e, Console.Error); *************** *** 130,134 **** } ! private static void handleClass(System.String classPackage, MappingElement me, System.Collections.Hashtable classMappings, System.Collections.IEnumerator classElements, MultiMap mm, bool extendz) { while (classElements.MoveNext()) --- 134,138 ---- } ! private static void handleClass(String classPackage, MappingElement me, Hashtable classMappings, IEnumerator classElements, MultiMap mm, bool extendz) { while (classElements.MoveNext()) *************** *** 143,148 **** else { ! System.String ex = (clazz.Attributes["extends"] == null?null:clazz.Attributes["extends"].Value); ! if ((System.Object) ex == null) { throw new MappingException("Missing extends attribute on <" + clazz.LocalName + " name=" + clazz.Attributes["name"].Value + ">"); --- 147,152 ---- 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 + ">"); Index: DOMRenderer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/DOMRenderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DOMRenderer.cs 25 Jul 2004 11:41:03 -0000 1.1 --- DOMRenderer.cs 13 Sep 2004 12:47:59 -0000 1.2 *************** *** 1,5 **** using System; ! using System.CodeDom; ! using System.CodeDom.Compiler; namespace NHibernate.Tool.hbm2net --- 1,5 ---- using System; ! using System.Collections; ! using System.IO; namespace NHibernate.Tool.hbm2net *************** *** 10,14 **** public class DOMRenderer : AbstractRenderer { ! public override void render(String savedToPackage, String savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StreamWriter writer) { } --- 10,14 ---- public class DOMRenderer : AbstractRenderer { ! public override void render(String savedToPackage, String savedToClass, ClassMapping classMapping, IDictionary class2classmap, StreamWriter writer) { } Index: ClassMapping.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/ClassMapping.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassMapping.cs 25 Jul 2004 11:41:03 -0000 1.1 --- ClassMapping.cs 13 Sep 2004 12:47:59 -0000 1.2 *************** *** 1,14 **** using System; using CompositeUserType = NHibernate.ICompositeUserType; using UserType = NHibernate.IUserType; - using PrimitiveType = NHibernate.Type.PrimitiveType; using Type = NHibernate.Type.TypeType; - using TypeFactory = NHibernate.Type.TypeFactory; - using ReflectHelper = NHibernate.Util.ReflectHelper; - using StringHelper = NHibernate.Util.StringHelper; using Element = System.Xml.XmlElement; using MultiMap = System.Collections.Hashtable; - using System.Xml; - using IType = NHibernate.Type.IType; namespace NHibernate.Tool.hbm2net --- 1,15 ---- using System; + using System.Collections; + using System.IO; + using System.Reflection; + using System.Xml; + using log4net; + using NHibernate.Type; + using NHibernate.Util; using CompositeUserType = NHibernate.ICompositeUserType; using UserType = NHibernate.IUserType; using Type = NHibernate.Type.TypeType; using Element = System.Xml.XmlElement; using MultiMap = System.Collections.Hashtable; namespace NHibernate.Tool.hbm2net *************** *** 18,22 **** public class ClassMapping:MappingElement { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private void InitBlock() --- 19,23 ---- public class ClassMapping:MappingElement { ! private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private void InitBlock() *************** *** 44,48 **** } /// <summary>shorthand method for getClassName().getFullyQualifiedName() </summary> ! virtual public System.String FullyQualifiedName { get --- 45,49 ---- } /// <summary>shorthand method for getClassName().getFullyQualifiedName() </summary> ! virtual public String FullyQualifiedName { get *************** *** 53,57 **** } /// <summary>shorthand method for getClassName().getName() </summary> ! virtual public System.String Name { get --- 54,58 ---- } /// <summary>shorthand method for getClassName().getName() </summary> ! virtual public String Name { get *************** *** 62,66 **** } /// <summary>shorthand method for getClassName().getPackageName() </summary> ! virtual public System.String PackageName { get --- 63,67 ---- } /// <summary>shorthand method for getClassName().getPackageName() </summary> ! virtual public String PackageName { get *************** *** 78,82 **** } ! virtual public System.String GeneratedName { get --- 79,83 ---- } ! virtual public String GeneratedName { get *************** *** 86,90 **** } ! virtual public System.String GeneratedPackageName { get --- 87,91 ---- } ! virtual public String GeneratedPackageName { get *************** *** 94,98 **** } ! virtual public System.String Proxy { get --- 95,99 ---- } ! virtual public String Proxy { get *************** *** 110,114 **** } ! virtual public System.String SuperClass { get --- 111,115 ---- } ! virtual public String SuperClass { get *************** *** 123,127 **** { SupportClass.ListCollectionSupport result = new SupportClass.ListCollectionSupport(); ! for (System.Collections.IEnumerator myFields = Fields.GetEnumerator(); myFields.MoveNext(); ) { FieldProperty field = (FieldProperty) myFields.Current; --- 124,128 ---- { SupportClass.ListCollectionSupport result = new SupportClass.ListCollectionSupport(); ! for (IEnumerator myFields = Fields.GetEnumerator(); myFields.MoveNext(); ) { FieldProperty field = (FieldProperty) myFields.Current; *************** *** 159,163 **** { SupportClass.ListCollectionSupport result = new SupportClass.ListCollectionSupport(); ! for (System.Collections.IEnumerator myFields = Fields.GetEnumerator(); myFields.MoveNext(); ) { FieldProperty field = (FieldProperty) myFields.Current; --- 160,164 ---- { SupportClass.ListCollectionSupport result = new SupportClass.ListCollectionSupport(); ! for (IEnumerator myFields = Fields.GetEnumerator(); myFields.MoveNext(); ) { FieldProperty field = (FieldProperty) myFields.Current; *************** *** 229,233 **** } ! public static System.Collections.IEnumerator Components { get --- 230,234 ---- } ! public static IEnumerator Components { get *************** *** 258,266 **** /// <returns> /// </returns> ! virtual public System.String Scope { get { ! System.String classScope = "public"; if (getMeta("scope-class") != null) { --- 259,267 ---- /// <returns> /// </returns> ! virtual public String Scope { get { ! String classScope = "public"; if (getMeta("scope-class") != null) { *************** *** 273,277 **** /// <returns> /// </returns> ! virtual public System.String DeclarationType { get --- 274,278 ---- /// <returns> /// </returns> ! virtual public String DeclarationType { get *************** *** 294,298 **** /// <returns> /// </returns> ! virtual public System.String Modifiers { get --- 295,299 ---- /// <returns> /// </returns> ! virtual public String Modifiers { get *************** *** 322,337 **** private ClassName name = null; private ClassName generatedName = null; ! private System.String superClass = null; private ClassMapping superClassMapping = null; ! private System.String proxyClass = null; private SupportClass.ListCollectionSupport fields; private SupportClass.TreeSetSupport imports; private SupportClass.ListCollectionSupport subclasses; ! private static readonly System.Collections.IDictionary components = new System.Collections.Hashtable(); private bool mustImplementEquals_Renamed_Field = false; private bool shouldBeAbstract_Renamed_Field = false; ! public ClassMapping(System.String classPackage, MappingElement parentElement, ClassName superClass, ClassMapping superClassMapping, Element classElement, MultiMap inheritedMeta):this(classPackage, parentElement, superClass, classElement, inheritedMeta) { --- 323,338 ---- private ClassName name = null; private ClassName generatedName = null; ! private String superClass = null; private ClassMapping superClassMapping = null; ! private String proxyClass = null; private SupportClass.ListCollectionSupport fields; private SupportClass.TreeSetSupport imports; private SupportClass.ListCollectionSupport subclasses; ! private static readonly IDictionary components = new Hashtable(); private bool mustImplementEquals_Renamed_Field = false; private bool shouldBeAbstract_Renamed_Field = false; ! public ClassMapping(String classPackage, MappingElement parentElement, ClassName superClass, ClassMapping superClassMapping, Element classElement, MultiMap inheritedMeta):this(classPackage, parentElement, superClass, classElement, inheritedMeta) { *************** *** 341,345 **** { SupportClass.ListCollectionSupport l = this.superClassMapping.AllFieldsForFullConstructor; ! for (System.Collections.IEnumerator iter = l.GetEnumerator(); iter.MoveNext(); ) { FieldProperty element = (FieldProperty) iter.Current; --- 342,346 ---- { SupportClass.ListCollectionSupport l = this.superClassMapping.AllFieldsForFullConstructor; ! for (IEnumerator iter = l.GetEnumerator(); iter.MoveNext(); ) { FieldProperty element = (FieldProperty) iter.Current; *************** *** 358,362 **** } ! public ClassMapping(System.String classPackage, MappingElement parentElement, ClassName superClass, Element classElement, MultiMap inheritedMeta):base(classElement, parentElement) { InitBlock(); --- 359,363 ---- } ! public ClassMapping(String classPackage, MappingElement parentElement, ClassName superClass, Element classElement, MultiMap inheritedMeta):base(classElement, parentElement) { InitBlock(); *************** *** 364,368 **** } ! public ClassMapping(System.String classPackage, Element classElement, MappingElement parentElement, MultiMap inheritedMeta):base(classElement, parentElement) { InitBlock(); --- 365,369 ---- } ! public ClassMapping(String classPackage, Element classElement, MappingElement parentElement, MultiMap inheritedMeta):base(classElement, parentElement) { InitBlock(); *************** *** 370,374 **** } ! public ClassMapping(System.String classPackage, Element classElement, MappingElement parentElement, bool component, MultiMap inheritedMeta):base(classElement, parentElement) { InitBlock(); --- 371,375 ---- } ! public ClassMapping(String classPackage, Element classElement, MappingElement parentElement, bool component, MultiMap inheritedMeta):base(classElement, parentElement) { InitBlock(); *************** *** 376,385 **** } ! protected internal virtual void initWith(System.String classPackage, ClassName mySuperClass, Element classElement, bool component, MultiMap inheritedMeta) { ! System.String fullyQualifiedName = (classElement.Attributes[component?"class":"name"] == null?string.Empty:classElement.Attributes[component?"class":"name"].Value); ! if (fullyQualifiedName.IndexOf((System.Char) '.') < 0 && (System.Object) classPackage != null && classPackage.Trim().Length > 0) { fullyQualifiedName = classPackage + "." + fullyQualifiedName; --- 377,386 ---- } ! protected internal virtual void initWith(String classPackage, ClassName mySuperClass, Element classElement, bool component, MultiMap inheritedMeta) { ! String fullyQualifiedName = (classElement.Attributes[component?"class":"name"] == null?string.Empty:classElement.Attributes[component?"class":"name"].Value); ! if (fullyQualifiedName.IndexOf('.') < 0 && (Object) classPackage != null && classPackage.Trim().Length > 0) { fullyQualifiedName = classPackage + "." + fullyQualifiedName; *************** *** 444,450 **** { implementEquals(); ! System.String cmpname = (cmpid.Attributes["name"] == null?null:cmpid.Attributes["name"].Value); ! System.String cmpclass = (cmpid.Attributes["class"] == null?null:cmpid.Attributes["class"].Value); ! if ((System.Object) cmpclass == null || cmpclass.Equals(string.Empty)) { //Embedded composite id --- 445,451 ---- { implementEquals(); ! String cmpname = (cmpid.Attributes["name"] == null?null:cmpid.Attributes["name"].Value); ! String cmpclass = (cmpid.Attributes["class"] == null?null:cmpid.Attributes["class"].Value); ! if ((Object) cmpclass == null || cmpclass.Equals(string.Empty)) { //Embedded composite id *************** *** 467,471 **** tempObject = mapping; components[mapping.FullyQualifiedName] = tempObject; - System.Object generatedAux = tempObject; } } --- 468,471 ---- *************** *** 478,488 **** // derive the class imports and fields from the properties ! for (System.Collections.IEnumerator properties = propertyList.GetEnumerator(); properties.MoveNext(); ) { Element property = (Element) properties.Current; MultiMap metaForProperty = MetaAttributeHelper.loadAndMergeMetaMap(property, MetaAttribs); ! System.String propertyName = (property.Attributes["name"] == null?null:property.Attributes["name"].Value); ! if ((System.Object) propertyName == null || propertyName.Trim().Equals(string.Empty)) { continue; //since an id doesn't necessarily need a name --- 478,488 ---- // derive the class imports and fields from the properties ! for (IEnumerator properties = propertyList.GetEnumerator(); properties.MoveNext(); ) { Element property = (Element) properties.Current; MultiMap metaForProperty = MetaAttributeHelper.loadAndMergeMetaMap(property, MetaAttribs); ! String propertyName = (property.Attributes["name"] == null?null:property.Attributes["name"].Value); ! if ((Object) propertyName == null || propertyName.Trim().Equals(string.Empty)) { continue; //since an id doesn't necessarily need a name *************** *** 490,495 **** // ensure that the type is specified ! System.String type = (property.Attributes["type"] == null?null:property.Attributes["type"].Value); ! if ((System.Object) type == null && cmpid != null) { // for composite-keys --- 490,495 ---- // ensure that the type is specified ! String type = (property.Attributes["type"] == null?null:property.Attributes["type"].Value); ! if ((Object) type == null && cmpid != null) { // for composite-keys *************** *** 506,510 **** } ! if ((System.Object) type == null || type.Trim().Equals(string.Empty)) { if (property == id) --- 506,510 ---- } ! if ((Object) type == null || type.Trim().Equals(string.Empty)) { if (property == id) *************** *** 523,528 **** { Element generator = property["generator"]; ! System.String unsavedValue = (property.Attributes["unsaved-value"] == null?null:property.Attributes["unsaved-value"].Value); ! bool mustBeNullable = ((System.Object) unsavedValue != null && unsavedValue.Equals("null")); bool generated = !(generator.Attributes["class"] == null?string.Empty:generator.Attributes["class"].Value).Equals("assigned"); ClassName rtype = getFieldType(type, mustBeNullable, false); --- 523,528 ---- { Element generator = property["generator"]; ! String unsavedValue = (property.Attributes["unsaved-value"] == null?null:property.Attributes["unsaved-value"].Value); ! bool mustBeNullable = ((Object) unsavedValue != null && unsavedValue.Equals("null")); bool generated = !(generator.Attributes["class"] == null?string.Empty:generator.Attributes["class"].Value).Equals("assigned"); ClassName rtype = getFieldType(type, mustBeNullable, false); *************** *** 533,540 **** else { ! System.String notnull = (property.Attributes["not-null"] == null?null:property.Attributes["not-null"].Value); // if not-null property is missing lets see if it has been // defined at column level ! if ((System.Object) notnull == null) { Element column = property["column"]; --- 533,540 ---- else { ! String notnull = (property.Attributes["not-null"] == null?null:property.Attributes["not-null"].Value); // if not-null property is missing lets see if it has been // defined at column level ! if ((Object) notnull == null) { Element column = property["column"]; *************** *** 542,546 **** notnull = (column.Attributes["not-null"] == null?null:column.Attributes["not-null"].Value); } ! bool nullable = ((System.Object) notnull == null || notnull.Equals("false")); bool key = property.LocalName.StartsWith("key-"); //a composite id property ClassName t = getFieldType(type); --- 542,546 ---- notnull = (column.Attributes["not-null"] == null?null:column.Attributes["not-null"].Value); } ! bool nullable = ((Object) notnull == null || notnull.Equals("false")); bool key = property.LocalName.StartsWith("key-"); //a composite id property ClassName t = getFieldType(type); *************** *** 552,564 **** // one to ones ! for (System.Collections.IEnumerator onetoones = classElement.SelectNodes("urn:one-to-one", CodeGenerator.nsmgr).GetEnumerator(); onetoones.MoveNext(); ) { Element onetoone = (Element) onetoones.Current; MultiMap metaForOneToOne = MetaAttributeHelper.loadAndMergeMetaMap(onetoone, MetaAttribs); ! System.String propertyName = (onetoone.Attributes["name"] == null?string.Empty:onetoone.Attributes["name"].Value); // ensure that the class is specified ! System.String clazz = (onetoone.Attributes["class"] == null?string.Empty:onetoone.Attributes["class"].Value); if (clazz.Length == 0) { --- 552,564 ---- // one to ones ! for (IEnumerator onetoones = classElement.SelectNodes("urn:one-to-one", CodeGenerator.nsmgr).GetEnumerator(); onetoones.MoveNext(); ) { Element onetoone = (Element) onetoones.Current; MultiMap metaForOneToOne = MetaAttributeHelper.loadAndMergeMetaMap(onetoone, MetaAttribs); ! String propertyName = (onetoone.Attributes["name"] == null?string.Empty:onetoone.Attributes["name"].Value); // ensure that the class is specified ! String clazz = (onetoone.Attributes["class"] == null?string.Empty:onetoone.Attributes["class"].Value); if (clazz.Length == 0) { *************** *** 573,585 **** // many to ones - TODO: consolidate with code above ! for (System.Collections.IEnumerator manytoOnes = manyToOneList.GetEnumerator(); manytoOnes.MoveNext(); ) { Element manyToOne = (Element) manytoOnes.Current; MultiMap metaForManyToOne = MetaAttributeHelper.loadAndMergeMetaMap(manyToOne, MetaAttribs); ! System.String propertyName = (manyToOne.Attributes["name"] == null?string.Empty:manyToOne.Attributes["name"].Value); // ensure that the type is specified ! System.String type = (manyToOne.Attributes["class"] == null?string.Empty:manyToOne.Attributes["class"].Value); if (type.Length == 0) { --- 573,585 ---- // many to ones - TODO: consolidate with code above ! for (IEnumerator manytoOnes = manyToOneList.GetEnumerator(); manytoOnes.MoveNext(); ) { Element manyToOne = (Element) manytoOnes.Current; MultiMap metaForManyToOne = MetaAttributeHelper.loadAndMergeMetaMap(manyToOne, MetaAttribs); ! String propertyName = (manyToOne.Attributes["name"] == null?string.Empty:manyToOne.Attributes["name"].Value); // ensure that the type is specified ! String type = (manyToOne.Attributes["class"] == null?string.Empty:manyToOne.Attributes["class"].Value); if (type.Length == 0) { *************** *** 590,595 **** // is it nullable? ! System.String notnull = (manyToOne.Attributes["not-null"] == null?null:manyToOne.Attributes["not-null"].Value); ! bool nullable = ((System.Object) notnull == null || notnull.Equals("false")); bool key = manyToOne.LocalName.StartsWith("key-"); //a composite id property --- 590,595 ---- // is it nullable? ! String notnull = (manyToOne.Attributes["not-null"] == null?null:manyToOne.Attributes["not-null"].Value); ! bool nullable = ((Object) notnull == null || notnull.Equals("false")); bool key = manyToOne.LocalName.StartsWith("key-"); //a composite id property *************** *** 614,624 **** //components ! for (System.Collections.IEnumerator iter = classElement.SelectNodes("urn:component", CodeGenerator.nsmgr).GetEnumerator(); iter.MoveNext(); ) { Element cmpe = (Element) iter.Current; MultiMap metaForComponent = MetaAttributeHelper.loadAndMergeMetaMap(cmpe, MetaAttribs); ! System.String cmpname = (cmpe.Attributes["name"] == null?null:cmpe.Attributes["name"].Value); ! System.String cmpclass = (cmpe.Attributes["class"] == null?null:cmpe.Attributes["class"].Value); ! if ((System.Object) cmpclass == null || cmpclass.Equals(string.Empty)) { log.Warn("component \"" + cmpname + "\" in class " + Name + " does not specify a class"); --- 614,624 ---- //components ! for (IEnumerator iter = classElement.SelectNodes("urn:component", CodeGenerator.nsmgr).GetEnumerator(); iter.MoveNext(); ) { Element cmpe = (Element) iter.Current; MultiMap metaForComponent = MetaAttributeHelper.loadAndMergeMetaMap(cmpe, MetaAttribs); ! String cmpname = (cmpe.Attributes["name"] == null?null:cmpe.Attributes["name"].Value); ! String cmpclass = (cmpe.Attributes["class"] == null?null:cmpe.Attributes["class"].Value); ! if ((Object) cmpclass == null || cmpclass.Equals(string.Empty)) { log.Warn("component \"" + cmpname + "\" in class " + Name + " does not specify a class"); *************** *** 635,639 **** tempObject2 = mapping; components[mapping.FullyQualifiedName] = tempObject2; - System.Object generatedAux2 = tempObject2; } --- 635,638 ---- *************** *** 641,645 **** // subclasses (done last so they can access this superclass for info) ! for (System.Collections.IEnumerator iter = classElement.SelectNodes("urn:subclass", CodeGenerator.nsmgr).GetEnumerator(); iter.MoveNext(); ) { Element subclass = (Element) iter.Current; --- 640,644 ---- // subclasses (done last so they can access this superclass for info) ! for (IEnumerator iter = classElement.SelectNodes("urn:subclass", CodeGenerator.nsmgr).GetEnumerator(); iter.MoveNext(); ) { Element subclass = (Element) iter.Current; *************** *** 648,652 **** } ! for (System.Collections.IEnumerator iter = classElement.SelectNodes("urn:joined-subclass", CodeGenerator.nsmgr).GetEnumerator(); iter.MoveNext(); ) { Element subclass = (Element) iter.Current; --- 647,651 ---- } ! for (IEnumerator iter = classElement.SelectNodes("urn:joined-subclass", CodeGenerator.nsmgr).GetEnumerator(); iter.MoveNext(); ) { Element subclass = (Element) iter.Current; *************** *** 667,671 **** else { ! throw new System.SystemException("Field " + fieldProperty + " is already associated with a class: " + fieldProperty.ParentClass); } } --- 666,670 ---- else { ! throw new SystemException("Field " + fieldProperty + " is already associated with a class: " + fieldProperty.ParentClass); } } *************** *** 711,715 **** } ! public virtual void addImport(System.String className) { ClassName cn = new ClassName(className); --- 710,714 ---- } ! public virtual void addImport(String className) { ClassName cn = new ClassName(className); *************** *** 717,747 **** } ! private void doCollections(System.String classPackage, Element classElement, System.String xmlName, System.String interfaceClass, System.String implementingClass, MultiMap inheritedMeta) { ! System.String originalInterface = interfaceClass; ! System.String originalImplementation = implementingClass; ! for (System.Collections.IEnumerator collections = classElement.SelectNodes("urn:" + xmlName, CodeGenerator.nsmgr).GetEnumerator(); collections.MoveNext(); ) { Element collection = (Element) collections.Current; MultiMap metaForCollection = MetaAttributeHelper.loadAndMergeMetaMap(collection, inheritedMeta); ! System.String propertyName = (collection.Attributes["name"] == null?string.Empty:collection.Attributes["name"].Value); //TODO: map and set in .net // Small hack to switch over to sortedSet/sortedMap if sort is specified. (that is sort != unsorted) ! System.String sortValue = (collection.Attributes["sort"] == null?null:collection.Attributes["sort"].Value); ! if ((System.Object) sortValue != null && !"unsorted".Equals(sortValue) && !"".Equals(sortValue.Trim())) { if ("map".Equals(xmlName)) { ! interfaceClass = typeof(System.Collections.IDictionary).FullName; ! implementingClass = typeof(System.Collections.IDictionary).FullName; } else if ("set".Equals(xmlName)) { ! interfaceClass = typeof(System.Collections.IDictionary).FullName; ! implementingClass = typeof(System.Collections.IDictionary).FullName; } } --- 716,746 ---- } ! private void doCollections(String classPackage, Element classElement, String xmlName, String interfaceClass, String implementingClass, MultiMap inheritedMeta) { ! String originalInterface = interfaceClass; ! String originalImplementation = implementingClass; ! for (IEnumerator collections = classElement.SelectNodes("urn:" + xmlName, CodeGenerator.nsmgr).GetEnumerator(); collections.MoveNext(); ) { Element collection = (Element) collections.Current; MultiMap metaForCollection = MetaAttributeHelper.loadAndMergeMetaMap(collection, inheritedMeta); ! String propertyName = (collection.Attributes["name"] == null?string.Empty:collection.Attributes["name"].Value); //TODO: map and set in .net // Small hack to switch over to sortedSet/sortedMap if sort is specified. (that is sort != unsorted) ! String sortValue = (collection.Attributes["sort"] == null?null:collection.Attributes["sort"].Value); ! if ((Object) sortValue != null && !"unsorted".Equals(sortValue) && !"".Equals(sortValue.Trim())) { if ("map".Equals(xmlName)) { ! interfaceClass = typeof(IDictionary).FullName; ! implementingClass = typeof(IDictionary).FullName; } else if ("set".Equals(xmlName)) { ! interfaceClass = typeof(IDictionary).FullName; ! implementingClass = typeof(IDictionary).FullName; } } *************** *** 783,787 **** foreignKeys.Add(collection["key"].Attributes["column"].Value); ! for (System.Collections.IEnumerator iter = collection["key"].SelectNodes("urn:column", CodeGenerator.nsmgr).GetEnumerator(); iter.MoveNext(); ) { if (((Element) iter.Current).Attributes["name"] != null) --- 782,786 ---- foreignKeys.Add(collection["key"].Attributes["column"].Value); ! for (IEnumerator iter = collection["key"].SelectNodes("urn:column", CodeGenerator.nsmgr).GetEnumerator(); iter.MoveNext(); ) { if (((Element) iter.Current).Attributes["name"] != null) *************** *** 795,802 **** if (collection.SelectNodes("urn:composite-element", CodeGenerator.nsmgr).Count != 0) { ! for (System.Collections.IEnumerator compositeElements = collection.SelectNodes("urn:composite-element", CodeGenerator.nsmgr).GetEnumerator(); compositeElements.MoveNext(); ) { Element compositeElement = (Element) compositeElements.Current; ! System.String compClass = compositeElement.Attributes["class"].Value; try --- 794,801 ---- if (collection.SelectNodes("urn:composite-element", CodeGenerator.nsmgr).Count != 0) { ! for (IEnumerator compositeElements = collection.SelectNodes("urn:composite-element", CodeGenerator.nsmgr).GetEnumerator(); compositeElements.MoveNext(); ) { Element compositeElement = (Element) compositeElements.Current; ! String compClass = compositeElement.Attributes["class"].Value; try *************** *** 809,815 **** tempObject = mapping; components[mapping.FullyQualifiedName] = tempObject; - System.Object generatedAux = tempObject; } ! catch (System.Exception e) { log.Error("Error building composite-element " + compClass, e); --- 808,813 ---- tempObject = mapping; components[mapping.FullyQualifiedName] = tempObject; } ! catch (Exception e) { log.Error("Error building composite-element " + compClass, e); *************** *** 820,832 **** } ! private void doArrays(Element classElement, System.String type, MultiMap inheritedMeta) { ! for (System.Collections.IEnumerator arrays = classElement.SelectNodes(type).GetEnumerator(); arrays.MoveNext(); ) { Element array = (Element) arrays.Current; MultiMap metaForArray = MetaAttributeHelper.loadAndMergeMetaMap(array, inheritedMeta); ! System.String role = array.Attributes["name"].Value; ! System.String elementClass = (array.Attributes["element-class"] == null?null:array.Attributes["element-class"].Value); ! if ((System.Object) elementClass == null) { Element elt = array["element"]; --- 818,830 ---- } ! private void doArrays(Element classElement, String type, MultiMap inheritedMeta) { ! for (IEnumerator arrays = classElement.SelectNodes(type).GetEnumerator(); arrays.MoveNext(); ) { Element array = (Element) arrays.Current; MultiMap metaForArray = MetaAttributeHelper.loadAndMergeMetaMap(array, inheritedMeta); ! String role = array.Attributes["name"].Value; ! String elementClass = (array.Attributes["element-class"] == null?null:array.Attributes["element-class"].Value); ! if ((Object) elementClass == null) { Element elt = array["element"]; *************** *** 843,847 **** } elementClass = (elt.Attributes["type"] == null?null:elt.Attributes["type"].Value); ! if ((System.Object) elementClass == null) elementClass = (elt.Attributes["class"] == null?string.Empty:elt.Attributes["class"].Value); } --- 841,845 ---- } elementClass = (elt.Attributes["type"] == null?null:elt.Attributes["type"].Value); ! if ((Object) elementClass == null) elementClass = (elt.Attributes["class"] == null?string.Empty:elt.Attributes["class"].Value); } *************** *** 854,858 **** } ! private ClassName getFieldType(System.String hibernateType) { return getFieldType(hibernateType, false, false); --- 852,856 ---- } ! private ClassName getFieldType(String hibernateType) { return getFieldType(hibernateType, false, false); *************** *** 864,876 **** /// <param name="hibernateType">Name of the hibernatetype (e.g. "binary") /// </param> - /// <param name="needObject"> - /// </param> /// <param name="isArray">if the type should be postfixed with array brackes ("[]") /// </param> /// <returns> /// </returns> ! private ClassName getFieldType(System.String hibernateType, bool mustBeNullable, bool isArray) { ! System.String postfix = isArray?"[]":""; // deal with hibernate binary type ClassName cn = null; --- 862,873 ---- /// <param name="hibernateType">Name of the hibernatetype (e.g. "binary") /// </param> /// <param name="isArray">if the type should be postfixed with array brackes ("[]") /// </param> + /// <param name="mustBeNullable"></param> /// <returns> /// </returns> ! private ClassName getFieldType(String hibernateType, bool mustBeNullable, bool isArray) { ! String postfix = isArray?"[]":""; // deal with hibernate binary type ClassName cn = null; *************** *** 910,914 **** /// <summary>Returns name of returnedclass if type is an UserType *</summary> ! private System.String getTypeForUserType(System.String type) { System.Type clazz = null; --- 907,911 ---- /// <summary>Returns name of returnedclass if type is an UserType *</summary> ! private String getTypeForUserType(String type) { System.Type clazz = null; *************** *** 923,927 **** UserType ut = (UserType) SupportClass.CreateNewInstance(clazz); log.Debug("Resolved usertype: " + type + " to " + ut.ReturnedType.Name); ! System.String t = clazzToName(ut.ReturnedType); return t; } --- 920,924 ---- UserType ut = (UserType) SupportClass.CreateNewInstance(clazz); log.Debug("Resolved usertype: " + type + " to " + ut.ReturnedType.Name); ! String t = clazzToName(ut.ReturnedType); return t; } *************** *** 931,939 **** CompositeUserType ut = (CompositeUserType) SupportClass.CreateNewInstance(clazz); log.Debug("Resolved composite usertype: " + type + " to " + ut.ReturnedClass.Name); ! System.String t = clazzToName(ut.ReturnedClass); return t; } } ! catch (System.IO.FileNotFoundException e) { if (type.IndexOf(",")>0) --- 928,936 ---- CompositeUserType ut = (CompositeUserType) SupportClass.CreateNewInstance(clazz); log.Debug("Resolved composite usertype: " + type + " to " + ut.ReturnedClass.Name); ! String t = clazzToName(ut.ReturnedClass); return t; } } ! catch (FileNotFoundException e) { if (type.IndexOf(",")>0) *************** *** 941,949 **** log.Warn("Could not find UserType: " + type + ". Using the type '" + type + "' directly instead. (" + e.ToString() + ")"); } ! catch (System.UnauthorizedAccessException iae) { log.Warn("Error while trying to resolve UserType. Using the type '" + type + "' directly instead. (" + iae.ToString() + ")"); } ! catch (System.Exception e) { log.Warn("Error while trying to resolve UserType. Using the type '" + type + "' directly instead. (" + e.ToString() + ")"); --- 938,946 ---- log.Warn("Could not find UserType: " + type + ". Using the type '" + type + "' directly instead. (" + e.ToString() + ")"); } ! catch (UnauthorizedAccessException iae) { log.Warn("Error while trying to resolve UserType. Using the type '" + type + "' directly instead. (" + iae.ToString() + ")"); } ! catch (Exception e) { log.Warn("Error while trying to resolve UserType. Using the type '" + type + "' directly instead. (" + e.ToString() + ")"); *************** *** 953,959 **** } ! private System.String clazzToName(System.Type cl) { ! System.String s = null; if (cl.IsArray) --- 950,956 ---- } ! private String clazzToName(System.Type cl) { ! String s = null; if (cl.IsArray) *************** *** 982,986 **** { // Inform that "extends" is not used if this one is a genuine subclass ! if ((System.Object) SuperClass != null && getMeta("extends") != null) { log.Warn("Warning: meta attribute extends='" + getMetaAsString("extends") + "' will be ignored for subclass " + name); --- 979,983 ---- { // Inform that "extends" is not used if this one is a genuine subclass ! if ((Object) SuperClass != null && getMeta("extends") != null) { log.Warn("Warning: meta attribute extends='" + getMetaAsString("extends") + "' will be ignored for subclass " + name); *************** *** 988,1000 **** } ! /// <seealso cref="java.lang.Object#toString()"> ! /// </seealso> ! public override System.String ToString() { return "ClassMapping: " + name.FullyQualifiedName; } - /// <param name="">subclassMapping - /// </param> public virtual void addSubClass(ClassMapping subclassMapping) { --- 985,993 ---- } ! public override String ToString() { return "ClassMapping: " + name.FullyQualifiedName; } public virtual void addSubClass(ClassMapping subclassMapping) { Index: ClassName.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/ClassName.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ClassName.cs 25 Jul 2004 11:41:03 -0000 1.1 --- ClassName.cs 13 Sep 2004 12:47:59 -0000 1.2 *************** *** 1,4 **** using System; ! using StringHelper = NHibernate.Util.StringHelper; namespace NHibernate.Tool.hbm2net --- 1,4 ---- using System; ! using NHibernate.Util; namespace NHibernate.Tool.hbm2net *************** *** 15,19 **** public class ClassName { ! virtual public System.String FullyQualifiedName { get --- 15,19 ---- public class ClassName { ! virtual public String FullyQualifiedName { get *************** *** 27,31 **** /// java.util.Set -> "Set" /// </summary> ! virtual public System.String Name { get --- 27,31 ---- /// java.util.Set -> "Set" /// </summary> ! virtual public String Name { get *************** *** 41,45 **** /// <returns> /// </returns> ! virtual public System.String PackageName { get --- 41,45 ---- /// <returns> /// </returns> ! virtual public String PackageName { get *************** *** 65,69 **** get { ! System.String baseTypeName = StringHelper.Replace(fullyQualifiedName, "[]", ""); return PRIMITIVES.Contains(baseTypeName); } --- 65,69 ---- get { ! String baseTypeName = StringHelper.Replace(fullyQualifiedName, "[]", ""); return PRIMITIVES.Contains(baseTypeName); } *************** *** 73,87 **** internal static readonly SupportClass.SetSupport PRIMITIVES = new SupportClass.HashSetSupport(); ! public ClassName(System.String fqn) { initFullyQualifiedName(fqn); } ! private System.String fullyQualifiedName = null; ! private System.String name = null; ! private System.String packageName = null; /// <summary>Two ClassName are equals if their fullyQualifiedName are the same/equals! </summary> ! public override bool Equals(System.Object other) { ClassName otherClassName = (ClassName) other; --- 73,87 ---- 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> ! public override bool Equals(Object other) { ClassName otherClassName = (ClassName) other; *************** *** 96,100 **** public virtual bool inSamePackage(ClassName other) { ! return (System.Object) other.packageName == (System.Object) this.packageName || ((System.Object) other.packageName != null && other.packageName.Equals(this.packageName)); } --- 96,100 ---- public virtual bool inSamePackage(ClassName other) { ! return (Object) other.packageName == (Object) this.packageName || ((Object) other.packageName != null && other.packageName.Equals(this.packageName)); } *************** *** 103,107 **** * Initialize the class fields with info from a fully qualified name. */ ! private void initFullyQualifiedName(System.String fqn) { this.fullyQualifiedName = fqn; --- 103,107 ---- * Initialize the class fields with info from a fully qualified name. */ ! private void initFullyQualifiedName(String fqn) { this.fullyQualifiedName = fqn; *************** *** 110,114 **** if (!Primitive) { ! if ((System.Object) fqn != null) { --- 110,114 ---- if (!Primitive) { ! if ((Object) fqn != null) { *************** *** 139,143 **** } ! public override System.String ToString() { return FullyQualifiedName; --- 139,143 ---- } ! public override String ToString() { return FullyQualifiedName; Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/AssemblyInfo.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AssemblyInfo.cs 2 Sep 2004 16:53:56 -0000 1.2 --- AssemblyInfo.cs 13 Sep 2004 12:47:59 -0000 1.3 *************** *** 1,5 **** using System.Reflection; - using System.Runtime.CompilerServices; - //------------------------------------------------------------------------------ // <autogenerated> --- 1,3 ---- *************** *** 12,23 **** //------------------------------------------------------------------------------ ! [assembly: AssemblyTitleAttribute("NHibernate.Tool.hbm2net for Microsoft .NET Framework 1.1")] ! [assembly: AssemblyDescriptionAttribute("Tool to Generate Classes from hbm.xml files.")] ! [assembly: AssemblyCompanyAttribute("nhibernate.sourceforge.net")] ! [assembly: AssemblyProductAttribute("NHibernate.Tool.hbm2net")] ! [assembly: AssemblyCopyrightAttribute("Licensed under LGPL.")] ! [assembly: AssemblyVersionAttribute("0.2.0.0")] ! [assembly: AssemblyInformationalVersionAttribute("0.2")] ! [assembly: AssemblyFileVersionAttribute("0.2.0.0")] ! [assembly: AssemblyDelaySignAttribute(false)] --- 10,21 ---- //------------------------------------------------------------------------------ ! [assembly: AssemblyTitle("NHibernate.Tool.hbm2net for Microsoft .NET Framework 1.1")] ! [assembly: AssemblyDescription("Tool to Generate Classes from hbm.xml files.")] ! [assembly: AssemblyCompany("nhibernate.sourceforge.net")] ! [assembly: AssemblyProduct("NHibernate.Tool.hbm2net")] ! [assembly: AssemblyCopyright("Licensed under LGPL.")] ! [assembly: AssemblyVersion("0.2.0.0")] ! [assembly: AssemblyInformationalVersion("0.2")] ! [assembly: AssemblyFileVersion("0.2.0.0")] ! [assembly: AssemblyDelaySign(false)] Index: BasicRenderer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/BasicRenderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BasicRenderer.cs 25 Jul 2004 11:41:03 -0000 1.1 --- BasicRenderer.cs 13 Sep 2004 12:47:59 -0000 1.2 *************** *** 159,170 **** /// <summary> Method doSupportMethods.</summary> ! /// <param name="">fieldTypes ! /// </param> ! /// <param name="">vetoSupport ! /// </param> ! /// <param name="">changeSupport ! /// </param> ! /// <param name="">propWriter ! /// </param> private void doSupportMethods(int fieldTypes, System.String vetoSupport, System.String changeSupport, System.IO.StringWriter writer) { --- 159,166 ---- /// <summary> Method doSupportMethods.</summary> ! /// <param name="changeSupport"></param> ! /// <param name="fieldTypes"></param> ! /// <param name="vetoSupport"></param> ! /// <param name="writer"></param> private void doSupportMethods(int fieldTypes, System.String vetoSupport, System.String changeSupport, System.IO.StringWriter writer) { *************** *** 193,201 **** /// <summary> Method doSupports.</summary> ! /// <param name="">vetoSupport /// </param> ! /// <param name="">changeSupport /// </param> ! /// <param name="">writer /// </param> private void doSupports(int fieldTypes, ClassMapping classMapping, System.String vetoSupport, System.String changeSupport, System.IO.StringWriter writer) --- 189,197 ---- /// <summary> Method doSupports.</summary> ! /// <param name="vetoSupport"> /// </param> ! /// <param name="changeSupport"> /// </param> ! /// <param name="writer"> /// </param> private void doSupports(int fieldTypes, ClassMapping classMapping, System.String vetoSupport, System.String changeSupport, System.IO.StringWriter writer) Index: AbstractRenderer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/AbstractRenderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractRenderer.cs 25 Jul 2004 11:41:03 -0000 1.1 --- AbstractRenderer.cs 13 Sep 2004 12:47:59 -0000 1.2 *************** *** 6,9 **** --- 6,13 ---- */ using System; + using System.Collections; + using System.Collections.Specialized; + using System.IO; + namespace NHibernate.Tool.hbm2net { *************** *** 14,40 **** { ! public virtual void render(System.String savedToPackage, System.String savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StreamWriter writer) { } ! internal System.Collections.Specialized.NameValueCollection properties; ! public virtual void configure(System.Collections.Specialized.NameValueCollection props) { this.properties = props; } ! public virtual System.String getFieldScope(FieldProperty field, System.String localScopeName, System.String defaultScope) { return field.getScope(localScopeName, defaultScope); } ! public virtual System.String getPackageDeclaration(System.String savedToPackage, ClassMapping classMapping) { ! if ((System.Object) savedToPackage != null && !savedToPackage.Trim().Equals("")) { return "namespace " + savedToPackage + ""; } ! else if ((System.Object) classMapping.GeneratedPackageName != null) { return "namespace " + classMapping.GeneratedPackageName + ""; --- 18,44 ---- { ! public virtual void render(String savedToPackage, String savedToClass, ClassMapping classMapping, IDictionary class2classmap, StreamWriter writer) { } ! internal NameValueCollection properties; ! public virtual void configure(NameValueCollection props) { this.properties = props; } ! public virtual String getFieldScope(FieldProperty field, String localScopeName, String defaultScope) { return field.getScope(localScopeName, defaultScope); } ! public virtual String getPackageDeclaration(String savedToPackage, ClassMapping classMapping) { ! if ((Object) savedToPackage != null && !savedToPackage.Trim().Equals("")) { return "namespace " + savedToPackage + ""; } ! else if ((Object) classMapping.GeneratedPackageName != null) { return "namespace " + classMapping.GeneratedPackageName + ""; *************** *** 43,49 **** } ! protected internal virtual void genPackageDelaration(System.String savedToPackage, ClassMapping classMapping, System.IO.StreamWriter w) { ! System.String string_Renamed = getPackageDeclaration(savedToPackage, classMapping); if (string_Renamed.Length > 0) { --- 47,53 ---- } ! protected internal virtual void genPackageDelaration(String savedToPackage, ClassMapping classMapping, StreamWriter w) { ! String string_Renamed = getPackageDeclaration(savedToPackage, classMapping); if (string_Renamed.Length > 0) { *************** *** 56,65 **** } ! public virtual System.String getSaveToClassName(ClassMapping classMapping) { return classMapping.GeneratedName; } ! public virtual System.String getSaveToPackage(ClassMapping classMapping) { return classMapping.GeneratedPackageName; --- 60,69 ---- } ! public virtual String getSaveToClassName(ClassMapping classMapping) { return classMapping.GeneratedName; } ! public virtual String getSaveToPackage(ClassMapping classMapping) { return classMapping.GeneratedPackageName; Index: FieldProperty.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/FieldProperty.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FieldProperty.cs 25 Jul 2004 11:41:03 -0000 1.1 --- FieldProperty.cs 13 Sep 2004 12:47:59 -0000 1.2 *************** *** 1,3 **** --- 1,5 ---- using System; + using System.Reflection; + using log4net; using MultiMap = System.Collections.Hashtable; using Element = System.Xml.XmlElement; *************** *** 9,13 **** public class FieldProperty:MappingElement { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public string fieldcase --- 11,15 ---- public class FieldProperty:MappingElement { ! private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string fieldcase *************** *** 27,31 **** } } ! virtual public System.String FieldName { get --- 29,33 ---- } } ! virtual public String FieldName { get *************** *** 35,39 **** } ! virtual public System.String AccessorName { get --- 37,41 ---- } ! virtual public String AccessorName { get *************** *** 43,47 **** } ! private System.String GetterType { get --- 45,49 ---- } ! private String GetterType { get *************** *** 51,55 **** } ! virtual public System.String FullyQualifiedTypeName { get --- 53,57 ---- } ! virtual public String FullyQualifiedTypeName { get *************** *** 106,111 **** /// </returns> /// <summary> Sets the foreignClass.</summary> - /// <param name="foreignClass">The foreignClass to set - /// </param> virtual public ClassName ForeignClass { --- 108,111 ---- *************** *** 135,139 **** /// <returns> String /// </returns> ! virtual public System.String GetterSignature { get --- 135,139 ---- /// <returns> String /// </returns> ! virtual public String GetterSignature { get *************** *** 172,176 **** } ! virtual public System.String FieldScope { get --- 172,176 ---- } ! virtual public String FieldScope { get *************** *** 180,184 **** } ! virtual public System.String PropertyGetScope { get --- 180,184 ---- } ! virtual public String PropertyGetScope { get *************** *** 188,192 **** } ! virtual public System.String PropertySetScope { get --- 188,192 ---- } ! virtual public String PropertySetScope { get *************** *** 198,205 **** /// <summary>the field name </summary> ! private System.String fieldName = null; /// <summary>the property name </summary> ! private System.String accessorName = null; /// <summary>true if this is part of an id </summary> --- 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> *************** *** 216,237 **** private ClassMapping parentClass; ! ! ! public FieldProperty(Element element, MappingElement parent, System.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, System.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, System.String name, ClassName type, ClassName implementationClassName, bool nullable, ClassName foreignClass, SupportClass.SetSupport foreignKeys, MultiMap metaattribs):base(element, pa... [truncated message content] |
From: Peter S. <sz...@us...> - 2004-09-13 12:13:56
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6063 Modified Files: StringResourceLoader.cs VelocityRenderer.cs Log Message: Fixed dll namespace - somebody renamed the dll, and forgot to fix it in the source... Index: StringResourceLoader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/StringResourceLoader.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StringResourceLoader.cs 25 Jul 2004 11:41:03 -0000 1.1 --- StringResourceLoader.cs 13 Sep 2004 12:13:42 -0000 1.2 *************** *** 6,14 **** */ using System; ! using ExtendedProperties = Commons.Collections.ExtendedProperties; using StringInputStream = System.IO.StringReader; ! using ResourceNotFoundException = NVelocity.Exception.ResourceNotFoundException; ! using Resource = NVelocity.Runtime.Resource.Resource; ! using ResourceLoader = NVelocity.Runtime.Resource.Loader.ResourceLoader; namespace NHibernate.Tool.hbm2net { --- 6,16 ---- */ using System; ! using System.IO; ! using System.Text; ! using Commons.Collections; ! using NVelocity.Runtime.Resource; ! using NVelocity.Runtime.Resource.Loader; using StringInputStream = System.IO.StringReader; ! namespace NHibernate.Tool.hbm2net { *************** *** 35,41 **** * @see org.apache.velocity.runtime.resource.loader.ResourceLoader#getResourceStream(java.lang.String) */ ! public override System.IO.Stream getResourceStream(System.String source) { ! return new System.IO.MemoryStream(System.Text.Encoding.ASCII.GetBytes(source)); } --- 37,43 ---- * @see org.apache.velocity.runtime.resource.loader.ResourceLoader#getResourceStream(java.lang.String) */ ! public override Stream getResourceStream(String source) { ! return new MemoryStream(Encoding.ASCII.GetBytes(source)); } *************** *** 43,47 **** * @see org.apache.velocity.runtime.resource.loader.ResourceLoader#isSourceModified(org.apache.velocity.runtime.resource.Resource) */ ! public override bool isSourceModified(NVelocity.Runtime.Resource.Resource resource) { return false; --- 45,49 ---- * @see org.apache.velocity.runtime.resource.loader.ResourceLoader#isSourceModified(org.apache.velocity.runtime.resource.Resource) */ ! public override bool isSourceModified(Resource resource) { return false; *************** *** 51,57 **** * @see org.apache.velocity.runtime.resource.loader.ResourceLoader#getLastModified(org.apache.velocity.runtime.resource.Resource) */ ! public override long getLastModified(NVelocity.Runtime.Resource.Resource resource) { ! return (System.DateTime.Now.Ticks - 621355968000000000) / 10000; } } --- 53,59 ---- * @see org.apache.velocity.runtime.resource.loader.ResourceLoader#getLastModified(org.apache.velocity.runtime.resource.Resource) */ ! public override long getLastModified(Resource resource) { ! return (DateTime.Now.Ticks - 621355968000000000) / 10000; } } Index: VelocityRenderer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/VelocityRenderer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VelocityRenderer.cs 25 Jul 2004 11:41:03 -0000 1.1 --- VelocityRenderer.cs 13 Sep 2004 12:13:42 -0000 1.2 *************** *** 61,66 **** public override void configure(System.Collections.Specialized.NameValueCollection props) { - // Commons.Collections.ExtendedProperties p = new Commons.Collections.ExtendedProperties(); - // p.SetProperty( "runtime.log.logsystem.log4net.category", "x"); System.IO.File.Delete("nvelocity.log"); base.configure (props); --- 61,64 ---- *************** *** 71,75 **** log.Info("No template file was specified, using default"); p.SetProperty("resource.loader", "class"); ! p.SetProperty("class.resource.loader.class", "NHibernate.Tool.hbm2net.StringResourceLoader;hbm2net"); templatename = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("NHibernate.Tool.hbm2net.convert.vm")).ReadToEnd(); } --- 69,73 ---- log.Info("No template file was specified, using default"); p.SetProperty("resource.loader", "class"); ! p.SetProperty("class.resource.loader.class", "NHibernate.Tool.hbm2net.StringResourceLoader;NHibernate.Tool.hbm2net"); templatename = new System.IO.StreamReader(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("NHibernate.Tool.hbm2net.convert.vm")).ReadToEnd(); } |
From: Michael D. <mik...@us...> - 2004-09-13 07:33:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18033/NHibernate/Mapping Modified Files: PersistentClass.cs Log Message: Added more xml comments. Index: PersistentClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/PersistentClass.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PersistentClass.cs 16 Aug 2004 05:27:07 -0000 1.13 --- PersistentClass.cs 13 Sep 2004 07:32:50 -0000 1.14 *************** *** 8,13 **** namespace NHibernate.Mapping { ! //TODO: H2.0.3 - there are some "set" declared on properties that I am not sure about - need ! // to double check those. public abstract class PersistentClass { --- 8,15 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// Base class for the <see cref="RootClass" /> mapped by <class> and a ! /// <see cref="Subclass"/> that is mapped by <subclass> or <joined-subclass> ! /// </summary> public abstract class PersistentClass { *************** *** 25,28 **** --- 27,37 ---- private bool dynamicUpdate; + /// <summary> + /// Gets or Sets if the Insert Sql is built dynamically. + /// </summary> + /// <value><c>true</c> if the Sql is built at runtime.</value> + /// <remarks> + /// The value of this is set by the <c>dynamic-insert</c> attribute. + /// </remarks> public virtual bool DynamicInsert { *************** *** 31,34 **** --- 40,50 ---- } + /// <summary> + /// Gets or Sets if the Update Sql is built dynamically. + /// </summary> + /// <value><c>true</c> if the Sql is built at runtime.</value> + /// <remarks> + /// The value of this is set by the <c>dynamic-update</c> attribute. + /// </remarks> public virtual bool DynamicUpdate { *************** *** 37,40 **** --- 53,67 ---- } + /// <summary> + /// Gets or Sets the value to use as the discriminator for the Class. + /// </summary> + /// <value> + /// A value that distinguishes this subclass in the database. + /// </value> + /// <remarks> + /// The value of this is set by the <c>discriminator-value</c> attribute. Each <subclass> + /// in a heirarchy must define a unique <c>discriminator-value</c>. The default value + /// is the class name if no value is supplied. + /// </remarks> public virtual string DiscriminatorValue { *************** *** 67,74 **** /// <summary> ! /// Gets the Collection of Subclasses for this PersistentClass. It will ! /// recursively go through Subclasses so that if a Subclass has Subclasses ! /// it will pick those up also. /// </summary> public virtual ICollection SubclassCollection { --- 94,103 ---- /// <summary> ! /// Gets the Collection of Subclasses for this PersistentClass. /// </summary> + /// <remarks> + /// It will recursively go through Subclasses so that if a Subclass has Subclasses + /// it will pick those up also. + /// </remarks> public virtual ICollection SubclassCollection { *************** *** 102,105 **** --- 131,141 ---- } + /// <summary> + /// Gets or Sets the <see cref="Table"/> that this class is stored in. + /// </summary> + /// <value>The <see cref="Table"/> this class is stored in.</value> + /// <remarks> + /// The value of this is set by the <c>table</c> attribute. + /// </remarks> public virtual Table Table { |
From: Michael D. <mik...@us...> - 2004-09-13 07:31:44
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17722/NHibernate/Dialect Modified Files: Dialect.cs Log Message: Obsoleted a method based on strings of sql. Index: Dialect.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Dialect/Dialect.cs,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Dialect.cs 25 Aug 2004 03:55:56 -0000 1.38 --- Dialect.cs 13 Sep 2004 07:31:34 -0000 1.39 *************** *** 416,419 **** --- 416,420 ---- /// <param name="querySelect"></param> /// <returns>The modified SQL</returns> + [Obsolete("Use the GetLimitString(SqlString) overload instead.")] public virtual string GetLimitString(String querySelect) { |
From: Michael D. <mik...@us...> - 2004-09-13 07:31:06
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17581/NHibernate/Impl Modified Files: SessionFactoryImpl.cs Log Message: removed code dealing with statementCache that was commented out. Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** SessionFactoryImpl.cs 13 Sep 2004 04:47:44 -0000 1.30 --- SessionFactoryImpl.cs 13 Sep 2004 07:30:56 -0000 1.31 *************** *** 731,736 **** } - //TODO: H2.0.3 - //if (statementCache!=null) statementCache.CloseAll(); try { --- 731,734 ---- |
From: Michael D. <mik...@us...> - 2004-09-13 07:22:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16087/NHibernate/SqlCommand Modified Files: SqlDeleteBuilder.cs SqlInsertBuilder.cs SqlSelectBuilder.cs SqlStringBuilder.cs SqlUpdateBuilder.cs Log Message: Set Initial Capacity on SqlStringBuilder in ToSqlString() methods. Index: SqlStringBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlStringBuilder.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SqlStringBuilder.cs 18 Aug 2004 20:15:04 -0000 1.4 --- SqlStringBuilder.cs 13 Sep 2004 07:22:38 -0000 1.5 *************** *** 187,191 **** { ! if(prefix!=null && prefix!=String.Empty) sqlParts.Add(prefix); bool opNeeded = false; --- 187,191 ---- { ! if( prefix!=null ) sqlParts.Add(prefix); bool opNeeded = false; *************** *** 209,213 **** } ! if(postfix!=null && postfix!=String.Empty) sqlParts.Add(postfix); return this; --- 209,213 ---- } ! if( postfix!=null ) sqlParts.Add(postfix); return this; Index: SqlDeleteBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlDeleteBuilder.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlDeleteBuilder.cs 30 Apr 2004 04:43:08 -0000 1.2 --- SqlDeleteBuilder.cs 13 Sep 2004 07:22:38 -0000 1.3 *************** *** 9,18 **** using NHibernate.Type; ! namespace NHibernate.SqlCommand { /// <summary> /// A class that builds an <c>DELETE</c> sql statement. /// </summary> ! public class SqlDeleteBuilder: SqlBaseBuilder, ISqlStringBuilder { ! string tableName; --- 9,20 ---- using NHibernate.Type; ! namespace NHibernate.SqlCommand ! { /// <summary> /// A class that builds an <c>DELETE</c> sql statement. /// </summary> ! public class SqlDeleteBuilder: SqlBaseBuilder, ISqlStringBuilder ! { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(SqlDeleteBuilder) ); string tableName; *************** *** 22,30 **** IList whereStrings = new ArrayList(); ! public SqlDeleteBuilder(ISessionFactoryImplementor factory): base(factory){ ! } ! public SqlDeleteBuilder SetTableName(string tableName) { this.tableName = tableName; return this; --- 24,33 ---- IList whereStrings = new ArrayList(); ! public SqlDeleteBuilder(ISessionFactoryImplementor factory): base(factory) ! { } ! public SqlDeleteBuilder SetTableName(string tableName) ! { this.tableName = tableName; return this; *************** *** 38,42 **** /// <param name="identityType">The IType of the Identity Property.</param> /// <returns>The SqlDeleteBuilder.</returns> ! public SqlDeleteBuilder SetIdentityColumn(string[] columnNames, IType identityType) { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, identityType); --- 41,46 ---- /// <param name="identityType">The IType of the Identity Property.</param> /// <returns>The SqlDeleteBuilder.</returns> ! public SqlDeleteBuilder SetIdentityColumn(string[] columnNames, IType identityType) ! { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, identityType); *************** *** 52,56 **** /// <param name="versionType">The IVersionType of the Version Property.</param> /// <returns>The SqlDeleteBuilder.</returns> ! public SqlDeleteBuilder SetVersionColumn(string[] columnNames, IVersionType versionType) { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, versionType); --- 56,61 ---- /// <param name="versionType">The IVersionType of the Version Property.</param> /// <returns>The SqlDeleteBuilder.</returns> ! public SqlDeleteBuilder SetVersionColumn(string[] columnNames, IVersionType versionType) ! { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, versionType); *************** *** 67,71 **** /// <param name="op">The operator to put between the column name and value.</param> /// <returns>The SqlDeleteBuilder</returns> ! public SqlDeleteBuilder AddWhereFragment(string[] columnNames, IType type, string op) { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, type); whereStrings.Add(ToWhereString(columnNames, parameters, op)); --- 72,77 ---- /// <param name="op">The operator to put between the column name and value.</param> /// <returns>The SqlDeleteBuilder</returns> ! public SqlDeleteBuilder AddWhereFragment(string[] columnNames, IType type, string op) ! { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, type); whereStrings.Add(ToWhereString(columnNames, parameters, op)); *************** *** 87,108 **** #region ISqlStringBuilder Members ! public SqlString ToSqlString() { ! // TODO: add default capacity ! SqlStringBuilder sqlBuilder = new SqlStringBuilder(); ! sqlBuilder.Add("DELETE FROM ") ! .Add(tableName) ! .Add(" WHERE "); ! if(whereStrings.Count > 1) { sqlBuilder.Add( (SqlString[])((ArrayList)whereStrings).ToArray(typeof(SqlString)), null, "AND", null, false); } ! else { sqlBuilder.Add((SqlString)whereStrings[0], null, null, null, false) ; } return sqlBuilder.ToSqlString(); } --- 93,141 ---- #region ISqlStringBuilder Members ! public SqlString ToSqlString() ! { ! // will for sure have 3 parts and then each item in the WhereStrings ! int initialCapacity = 3; ! // add an "AND" for each whereString except the first one. ! initialCapacity += (whereStrings.Count -1); ! ! for( int i=0; i<whereStrings.Count; i++ ) ! { ! initialCapacity += ((SqlString)whereStrings[i]).Count; ! } ! ! SqlStringBuilder sqlBuilder = new SqlStringBuilder( initialCapacity + 2 ); ! sqlBuilder.Add( "DELETE FROM " ) ! .Add( tableName ) ! .Add( " WHERE " ); ! if(whereStrings.Count > 1) ! { sqlBuilder.Add( (SqlString[])((ArrayList)whereStrings).ToArray(typeof(SqlString)), null, "AND", null, false); } ! else ! { sqlBuilder.Add((SqlString)whereStrings[0], null, null, null, false) ; } + if(log.IsDebugEnabled) + { + if( initialCapacity < sqlBuilder.Count ) + { + log.Debug( + "The initial capacity was set too low at: " + initialCapacity + " for the DeleteSqlBuilder " + + "that needed a capacity of: " + sqlBuilder.Count + " for the table " + tableName ); + } + else if( initialCapacity > 16 && ((float)initialCapacity/sqlBuilder.Count) > 1.2 ) + { + log.Debug( + "The initial capacity was set too high at: " + initialCapacity + " for the DeleteSqlBuilder " + + "that needed a capacity of: " + sqlBuilder.Count + " for the table " + tableName); + } + } return sqlBuilder.ToSqlString(); } Index: SqlUpdateBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlUpdateBuilder.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SqlUpdateBuilder.cs 30 Apr 2004 04:43:08 -0000 1.2 --- SqlUpdateBuilder.cs 13 Sep 2004 07:22:38 -0000 1.3 *************** *** 15,19 **** /// A class that builds an <c>UPDATE</c> sql statement. /// </summary> ! public class SqlUpdateBuilder: SqlBaseBuilder, ISqlStringBuilder { string tableName; --- 15,21 ---- /// A class that builds an <c>UPDATE</c> sql statement. /// </summary> ! public class SqlUpdateBuilder: SqlBaseBuilder, ISqlStringBuilder ! { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(SqlUpdateBuilder) ); string tableName; *************** *** 27,35 **** IList whereStrings = new ArrayList(); ! public SqlUpdateBuilder(ISessionFactoryImplementor factory) : base(factory) { ! } ! public SqlUpdateBuilder SetTableName(string tableName) { this.tableName = tableName; return this; --- 29,38 ---- IList whereStrings = new ArrayList(); ! public SqlUpdateBuilder(ISessionFactoryImplementor factory) : base(factory) ! { } ! public SqlUpdateBuilder SetTableName(string tableName) ! { this.tableName = tableName; return this; *************** *** 45,49 **** /// <param name="literalType">The NHibernateType to use to convert the value to a sql string.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder AddColumn(string columnName, object val, ILiteralType literalType) { return AddColumn(columnName, literalType.ObjectToSQLString(val)); } --- 48,53 ---- /// <param name="literalType">The NHibernateType to use to convert the value to a sql string.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder AddColumn(string columnName, object val, ILiteralType literalType) ! { return AddColumn(columnName, literalType.ObjectToSQLString(val)); } *************** *** 56,60 **** /// <param name="val">A valid sql string to set as the value of the column.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder AddColumn(string columnName, string val) { columnNames.Add(columnName); --- 60,65 ---- /// <param name="val">A valid sql string to set as the value of the column.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder AddColumn(string columnName, string val) ! { columnNames.Add(columnName); *************** *** 70,74 **** /// <param name="val">A valid sql string to set as the value of the column.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder AddColumns(string[] columnName, string val) { for(int i = 0; i < columnName.Length; i++) { --- 75,80 ---- /// <param name="val">A valid sql string to set as the value of the column.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder AddColumns(string[] columnName, string val) ! { for(int i = 0; i < columnName.Length; i++) { *************** *** 86,90 **** /// <param name="propertyType">The IType of the property.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder AddColumns(string[] columnNames, IType propertyType) { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, propertyType); --- 92,97 ---- /// <param name="propertyType">The IType of the property.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder AddColumns(string[] columnNames, IType propertyType) ! { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, propertyType); *************** *** 103,107 **** /// <param name="identityType">The IType of the Identity Property.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder SetIdentityColumn(string[] columnNames, IType identityType) { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, identityType); --- 110,115 ---- /// <param name="identityType">The IType of the Identity Property.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder SetIdentityColumn(string[] columnNames, IType identityType) ! { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, identityType); *************** *** 117,121 **** /// <param name="versionType">The IVersionType of the Version Property.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder SetVersionColumn(string[] columnNames, IVersionType versionType) { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, versionType); --- 125,130 ---- /// <param name="versionType">The IVersionType of the Version Property.</param> /// <returns>The SqlUpdateBuilder.</returns> ! public SqlUpdateBuilder SetVersionColumn(string[] columnNames, IVersionType versionType) ! { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, versionType); *************** *** 132,136 **** /// <param name="op">The operator to put between the column name and value.</param> /// <returns>The SqlUpdateBuilder</returns> ! public SqlUpdateBuilder AddWhereFragment(string[] columnNames, IType type, string op) { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, type); whereStrings.Add(ToWhereString(columnNames, parameters, op)); --- 141,146 ---- /// <param name="op">The operator to put between the column name and value.</param> /// <returns>The SqlUpdateBuilder</returns> ! public SqlUpdateBuilder AddWhereFragment(string[] columnNames, IType type, string op) ! { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, type); whereStrings.Add(ToWhereString(columnNames, parameters, op)); *************** *** 153,159 **** #region ISqlStringBuilder Members ! public SqlString ToSqlString() { ! // TODO: Add default capacity ! SqlStringBuilder sqlBuilder = new SqlStringBuilder(); bool commaNeeded = false; --- 163,191 ---- #region ISqlStringBuilder Members ! public SqlString ToSqlString() ! { ! // 3 = "UPDATE", tableName, "SET" ! int initialCapacity = 3; ! ! // will have a comma for all but the first column, and then for each column ! // will have a name, " = ", value so mulitply by 3 ! if( columnNames.Count > 0 ) ! { ! initialCapacity += (columnNames.Count - 1) + (columnNames.Count * 3); ! } ! // 1 = "WHERE" ! initialCapacity++; ! ! // the "AND" before all but the first whereString ! if( whereStrings.Count > 0 ) ! { ! initialCapacity += (whereStrings.Count -1); ! for( int i=0; i <whereStrings.Count; i++ ) ! { ! initialCapacity += ((SqlString)whereStrings[i]).Count; ! } ! } ! ! SqlStringBuilder sqlBuilder = new SqlStringBuilder( initialCapacity + 2 ); bool commaNeeded = false; *************** *** 165,170 **** .Add(" SET "); ! for(int i = 0; i < columnNames.Count; i++){ ! if(commaNeeded) sqlBuilder.Add(StringHelper.CommaSpace); commaNeeded = true; --- 197,202 ---- .Add(" SET "); ! for(int i = 0; i < columnNames.Count; i++) ! { if(commaNeeded) sqlBuilder.Add(StringHelper.CommaSpace); commaNeeded = true; *************** *** 177,184 **** Parameter param = columnValue as Parameter; ! if(param!=null) { sqlBuilder.Add(param); } ! else { sqlBuilder.Add((string)columnValue); } --- 209,218 ---- Parameter param = columnValue as Parameter; ! if(param!=null) ! { sqlBuilder.Add(param); } ! else ! { sqlBuilder.Add((string)columnValue); } *************** *** 188,192 **** sqlBuilder.Add(" WHERE "); ! foreach(SqlString whereString in whereStrings) { if(andNeeded) sqlBuilder.Add(" AND "); andNeeded = true; --- 222,227 ---- sqlBuilder.Add(" WHERE "); ! foreach(SqlString whereString in whereStrings) ! { if(andNeeded) sqlBuilder.Add(" AND "); andNeeded = true; *************** *** 196,199 **** --- 231,250 ---- } + if(log.IsDebugEnabled) + { + if( initialCapacity < sqlBuilder.Count ) + { + log.Debug( + "The initial capacity was set too low at: " + initialCapacity + " for the UpdateSqlBuilder " + + "that needed a capacity of: " + sqlBuilder.Count + " for the table " + tableName ); + } + else if( initialCapacity > 16 && ((float)initialCapacity/sqlBuilder.Count) > 1.2 ) + { + log.Debug( + "The initial capacity was set too high at: " + initialCapacity + " for the UpdateSqlBuilder " + + "that needed a capacity of: " + sqlBuilder.Count + " for the table " + tableName); + } + } + return sqlBuilder.ToSqlString(); } Index: SqlSelectBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlSelectBuilder.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SqlSelectBuilder.cs 28 Aug 2004 05:26:36 -0000 1.3 --- SqlSelectBuilder.cs 13 Sep 2004 07:22:38 -0000 1.4 *************** *** 17,20 **** --- 17,22 ---- public class SqlSelectBuilder: SqlBaseBuilder, ISqlStringBuilder { + private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(SqlSelectBuilder) ); + private string selectClause; private string fromClause; *************** *** 27,31 **** public SqlSelectBuilder(ISessionFactoryImplementor factory): base(factory) { - } --- 29,32 ---- *************** *** 167,173 **** public SqlString ToSqlString() { ! //TODO: set a default capacity ! SqlStringBuilder sqlBuilder = new SqlStringBuilder(); sqlBuilder.Add("SELECT ") --- 168,185 ---- public SqlString ToSqlString() { + // 4 = the "SELECT", selectClause, "FROM", fromClause are straight strings + // plus the number of parts in outerJoinsAfterFrom SqlString. + // 1 = the "WHERE" + // plus the number of parts in outerJoinsAfterWhere SqlString. + // 2 = the "ORDER BY" and orderByClause + int initialCapacity = 4 + outerJoinsAfterFrom.Count + 1 + outerJoinsAfterWhere.Count + 2; ! // move through each whereSqlString to find the capacity ! for( int i=0; i<whereSqlStrings.Count; i++ ) ! { ! initialCapacity += ((SqlString)whereSqlStrings[i]).Count; ! } ! ! SqlStringBuilder sqlBuilder = new SqlStringBuilder( initialCapacity + 2 ); sqlBuilder.Add("SELECT ") *************** *** 187,191 **** else { ! sqlBuilder.Add((SqlString)whereSqlStrings[0], null, null, null, false); } --- 199,203 ---- else { ! sqlBuilder.Add( (SqlString)whereSqlStrings[0], null, null, null, false ); } *************** *** 198,201 **** --- 210,229 ---- } + if(log.IsDebugEnabled) + { + if( initialCapacity < sqlBuilder.Count ) + { + log.Debug( + "The initial capacity was set too low at: " + initialCapacity + " for the SelectSqlBuilder " + + "that needed a capacity of: " + sqlBuilder.Count + " for the table " + fromClause ); + } + else if( initialCapacity > 16 && ((float)initialCapacity/sqlBuilder.Count) > 1.2 ) + { + log.Debug( + "The initial capacity was set too high at: " + initialCapacity + " for the SelectSqlBuilder " + + "that needed a capacity of: " + sqlBuilder.Count + " for the table " + fromClause ); + } + } + return sqlBuilder.ToSqlString(); Index: SqlInsertBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlInsertBuilder.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SqlInsertBuilder.cs 10 Feb 2004 18:38:55 -0000 1.1 --- SqlInsertBuilder.cs 13 Sep 2004 07:22:38 -0000 1.2 *************** *** 10,19 **** using NHibernate.Util; ! namespace NHibernate.SqlCommand { ! /// <summary> /// A class that builds an <c>INSERT</c> sql statement. /// </summary> ! public class SqlInsertBuilder: ISqlStringBuilder { ISessionFactoryImplementor factory; --- 10,21 ---- using NHibernate.Util; ! namespace NHibernate.SqlCommand ! { /// <summary> /// A class that builds an <c>INSERT</c> sql statement. /// </summary> ! public class SqlInsertBuilder: ISqlStringBuilder ! { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger( typeof(SqlInsertBuilder) ); ISessionFactoryImplementor factory; *************** *** 24,32 **** //SortedList columnValues = new SortedList(); //key=columName, value=string/IParameter ! public SqlInsertBuilder(ISessionFactoryImplementor factory){ this.factory = factory; } ! public SqlInsertBuilder SetTableName(string tableName) { this.tableName = tableName; return this; --- 26,36 ---- //SortedList columnValues = new SortedList(); //key=columName, value=string/IParameter ! public SqlInsertBuilder(ISessionFactoryImplementor factory) ! { this.factory = factory; } ! public SqlInsertBuilder SetTableName(string tableName) ! { this.tableName = tableName; return this; *************** *** 39,46 **** /// <param name="propertyType">The IType of the property.</param> /// <returns>The SqlInsertBuilder.</returns> ! public SqlInsertBuilder AddColumn(string[] columnNames, IType propertyType) { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, propertyType); ! for(int i = 0; i < columnNames.Length; i++) { this.columnNames.Add(columnNames[i]); columnValues.Add(parameters[i]); --- 43,52 ---- /// <param name="propertyType">The IType of the property.</param> /// <returns>The SqlInsertBuilder.</returns> ! public SqlInsertBuilder AddColumn(string[] columnNames, IType propertyType) ! { Parameter[] parameters = Parameter.GenerateParameters(factory, columnNames, propertyType); ! for(int i = 0; i < columnNames.Length; i++) ! { this.columnNames.Add(columnNames[i]); columnValues.Add(parameters[i]); *************** *** 57,61 **** /// <param name="literalType">The NHibernateType to use to convert the value to a sql string.</param> /// <returns>The SqlInsertBuilder.</returns> ! public SqlInsertBuilder AddColumn(string columnName, object val, ILiteralType literalType) { return AddColumn(columnName, literalType.ObjectToSQLString(val)); } --- 63,68 ---- /// <param name="literalType">The NHibernateType to use to convert the value to a sql string.</param> /// <returns>The SqlInsertBuilder.</returns> ! public SqlInsertBuilder AddColumn(string columnName, object val, ILiteralType literalType) ! { return AddColumn(columnName, literalType.ObjectToSQLString(val)); } *************** *** 68,73 **** /// <param name="val">A valid sql string to set as the value of the column.</param> /// <returns>The SqlInsertBuilder.</returns> ! public SqlInsertBuilder AddColumn(string columnName, string val) { ! columnNames.Add(columnName); columnValues.Add(val); --- 75,80 ---- /// <param name="val">A valid sql string to set as the value of the column.</param> /// <returns>The SqlInsertBuilder.</returns> ! public SqlInsertBuilder AddColumn(string columnName, string val) ! { columnNames.Add(columnName); columnValues.Add(val); *************** *** 76,95 **** } - - #region ISqlStringBuilder Members ! public SqlString ToSqlString() { ! //TODO: add a default capacity ! SqlStringBuilder sqlBuilder = new SqlStringBuilder(); sqlBuilder.Add("INSERT INTO ") .Add(tableName); ! ! if(columnNames.Count == 0 ) { sqlBuilder.Add(" ").Add( factory.Dialect.NoColumnsInsertString ); } ! else { sqlBuilder.Add(" ("); --- 83,114 ---- } #region ISqlStringBuilder Members ! public SqlString ToSqlString() ! { ! // 5 = "INSERT INTO", tableName, " (" , ") VALUES (", and ")" ! int initialCapacity = 5; ! ! // 2 = the first column is just the columnName and columnValue ! initialCapacity += 2; ! ! // eachColumn after the first one is 4 because of the ", ", columnName ! // and the ", " columnValue ! if( columnNames.Count > 0 ) ! { ! initialCapacity += ( (columnNames.Count-1) * 4); ! } ! ! SqlStringBuilder sqlBuilder = new SqlStringBuilder( initialCapacity + 2 ); sqlBuilder.Add("INSERT INTO ") .Add(tableName); ! if(columnNames.Count == 0 ) ! { sqlBuilder.Add(" ").Add( factory.Dialect.NoColumnsInsertString ); } ! else ! { sqlBuilder.Add(" ("); *************** *** 98,139 **** bool commaNeeded = false; ! foreach(string columnName in columnNames){ ! // build up the column list if(commaNeeded) sqlBuilder.Add(StringHelper.CommaSpace); sqlBuilder.Add(columnName); commaNeeded = true; - } ! sqlBuilder.Add( ") VALUES ("); commaNeeded = false; ! foreach(object obj in columnValues) { ! if(commaNeeded) sqlBuilder.Add(StringHelper.CommaSpace); commaNeeded = true; Parameter param = obj as Parameter; ! if(param!=null) { sqlBuilder.Add(param); } ! else { sqlBuilder.Add((string)obj); } - - } - sqlBuilder.Add(")"); ! } return sqlBuilder.ToSqlString(); - - } --- 117,168 ---- bool commaNeeded = false; ! foreach(string columnName in columnNames) ! { // build up the column list if(commaNeeded) sqlBuilder.Add(StringHelper.CommaSpace); sqlBuilder.Add(columnName); commaNeeded = true; } ! sqlBuilder.Add( ") VALUES (" ); commaNeeded = false; ! foreach(object obj in columnValues) ! { if(commaNeeded) sqlBuilder.Add(StringHelper.CommaSpace); commaNeeded = true; Parameter param = obj as Parameter; ! if(param!=null) ! { sqlBuilder.Add(param); } ! else ! { sqlBuilder.Add((string)obj); } } sqlBuilder.Add(")"); ! } + if(log.IsDebugEnabled) + { + if( initialCapacity < sqlBuilder.Count ) + { + log.Debug( + "The initial capacity was set too low at: " + initialCapacity + " for the InsertSqlBuilder " + + "that needed a capacity of: " + sqlBuilder.Count + " for the table " + tableName ); + } + else if( initialCapacity > 16 && ((float)initialCapacity/sqlBuilder.Count) > 1.2 ) + { + log.Debug( + "The initial capacity was set too high at: " + initialCapacity + " for the InsertSqlBuilder " + + "that needed a capacity of: " + sqlBuilder.Count + " for the table " + tableName ); + } } return sqlBuilder.ToSqlString(); } |
From: Michael D. <mik...@us...> - 2004-09-13 07:11:14
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13720/NHibernate/SqlCommand Modified Files: SqlString.cs Log Message: Added a Count property on SqlString to help with creating SqlStringBuilders with the correct initial capacity Index: SqlString.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlString.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** SqlString.cs 26 Aug 2004 14:27:43 -0000 1.13 --- SqlString.cs 13 Sep 2004 07:11:05 -0000 1.14 *************** *** 147,150 **** --- 147,180 ---- /// <summary> + /// Gets the number of SqlParts contained in this SqlString. + /// </summary> + /// <value>The number of SqlParts contained in this SqlString.</value> + /// <remarks> + /// If a SqlPart contains a SqlString then this recursively looks at each SqlPart + /// for the Count. + /// </remarks> + public int Count + { + get + { + int count = 0; + for( int i=0; i<sqlParts.Length; i++ ) + { + SqlString sqlString = sqlParts[i] as SqlString; + if( sqlString!=null ) + { + count += sqlString.Count; + } + else + { + count++; + } + } + + return count; + } + } + + /// <summary> /// Determines whether the end of this instance matches the specified String. /// </summary> |
From: Michael D. <mik...@us...> - 2004-09-13 07:11:14
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13720/NHibernate.Test/SqlCommandTest Modified Files: SqlStringFixture.cs Log Message: Added a Count property on SqlString to help with creating SqlStringBuilders with the correct initial capacity Index: SqlStringFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SqlCommandTest/SqlStringFixture.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SqlStringFixture.cs 26 Aug 2004 14:28:44 -0000 1.4 --- SqlStringFixture.cs 13 Sep 2004 07:11:05 -0000 1.5 *************** *** 121,124 **** --- 121,140 ---- [Test] + public void Count() + { + SqlString sql = new SqlString( new object[] {"select", " from table where a = ", new Parameter(), " and b = " , new Parameter() } ); + Assert.AreEqual( 5, sql.Count, "Count with no nesting failed." ); + + sql = sql.Append( new SqlString( new object[] {" more parts ", " another part "} ) ); + Assert.AreEqual( 7, sql.Count, "Added a SqlString to a SqlString" ); + + SqlString nestedSql = new SqlString( new object[] { "nested 1", "nested 2" } ); + + sql = sql.Append( new SqlString( new object[] { nestedSql, " not nested 1", " not nested 2" } ) ); + + Assert.AreEqual( 11, sql.Count, "Added 2 more levels of nesting" ); + } + + [Test] public void EndsWith() { |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30623/NHibernate Modified Files: ADOException.cs AssertionFailure.cs CallbackException.cs HibernateException.cs InstantiationException.cs LazyInitializationException.cs MappingException.cs ObjectDeletedException.cs ObjectNotFoundException.cs PersistentObjectException.cs PropertyAccessException.cs PropertyNotFoundException.cs QueryException.cs StaleObjectStateException.cs TransactionException.cs TransientObjectException.cs ValidationFailure.cs WrongClassException.cs Log Message: NH-99: Marked Exceptions as serializable. Index: ObjectDeletedException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ObjectDeletedException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ObjectDeletedException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- ObjectDeletedException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,19 **** using System; ! namespace NHibernate { ! /// <summary> /// Thrown when the user tries to pass a deleted object to the <c>ISession</c>. /// </summary> ! public class ObjectDeletedException : HibernateException { private object identifier; ! public ObjectDeletedException(string msg, object identifier) : base(msg) { this.identifier = identifier; } ! public object Identifier { get { return identifier; } } ! public override string Message { get { return base.Message + ": " + identifier; } } --- 1,26 ---- using System; ! namespace NHibernate ! { /// <summary> /// Thrown when the user tries to pass a deleted object to the <c>ISession</c>. /// </summary> ! [Serializable] ! public class ObjectDeletedException : HibernateException ! { private object identifier; ! public ObjectDeletedException(string msg, object identifier) : base(msg) ! { this.identifier = identifier; } ! ! public object Identifier ! { get { return identifier; } } ! ! public override string Message ! { get { return base.Message + ": " + identifier; } } Index: CallbackException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/CallbackException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CallbackException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- CallbackException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,8 **** using System; ! namespace NHibernate { ! ! public class CallbackException : HibernateException { ! public CallbackException(Exception root) : base("An exception occured in a callback", root) {} --- 1,9 ---- using System; ! namespace NHibernate ! { ! [Serializable] ! public class CallbackException : HibernateException ! { public CallbackException(Exception root) : base("An exception occured in a callback", root) {} Index: PropertyAccessException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/PropertyAccessException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PropertyAccessException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- PropertyAccessException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,14 **** using System; ! namespace NHibernate { /// <summary> /// A problem occurred accessing a property of an instance of a persistent class by reflection /// </summary> ! public class PropertyAccessException : HibernateException { private System.Type persistentType; private string propertyName; private bool wasSetter; ! public PropertyAccessException(Exception root, string s, bool wasSetter, System.Type persistentType, string propertyName) : base(s, root) { this.persistentType = persistentType; this.wasSetter = wasSetter; --- 1,18 ---- using System; ! namespace NHibernate ! { /// <summary> /// A problem occurred accessing a property of an instance of a persistent class by reflection /// </summary> ! [Serializable] ! public class PropertyAccessException : HibernateException ! { private System.Type persistentType; private string propertyName; private bool wasSetter; ! public PropertyAccessException(Exception root, string s, bool wasSetter, System.Type persistentType, string propertyName) : base(s, root) ! { this.persistentType = persistentType; this.wasSetter = wasSetter; *************** *** 16,25 **** } ! public System.Type PersistentType { get { return persistentType; } } ! public override string Message { ! get { return base.Message + ( wasSetter ? " setter of " : " getter of ") + --- 20,32 ---- } ! public System.Type PersistentType ! { get { return persistentType; } } ! public override string Message ! { ! get ! { return base.Message + ( wasSetter ? " setter of " : " getter of ") + Index: PersistentObjectException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/PersistentObjectException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PersistentObjectException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- PersistentObjectException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,11 **** using System; ! namespace NHibernate { ! /// <summary> /// Thrown when the user passes a persistent instance to a <c>ISession</c> method that expects a /// transient instance /// </summary> ! public class PersistentObjectException : HibernateException { public PersistentObjectException(string s) : base(s) {} } --- 1,13 ---- using System; ! namespace NHibernate ! { /// <summary> /// Thrown when the user passes a persistent instance to a <c>ISession</c> method that expects a /// transient instance /// </summary> ! [Serializable] ! public class PersistentObjectException : HibernateException ! { public PersistentObjectException(string s) : base(s) {} } Index: StaleObjectStateException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/StaleObjectStateException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StaleObjectStateException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- StaleObjectStateException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> /// Thrown when a version number check failed, indicating that the --- 1,6 ---- using System; ! namespace NHibernate ! { /// <summary> /// Thrown when a version number check failed, indicating that the *************** *** 7,30 **** /// versioning). /// </summary> ! public class StaleObjectStateException : HibernateException { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(StaleObjectStateException)); private System.Type persistentType; private object identifier; ! public StaleObjectStateException(System.Type persistentType, object identifier) : base("Row was updated or deleted by another transaction") { this.persistentType = persistentType; this.identifier = identifier; ! log.Error("An operation failed due to stale data", this); } ! public System.Type PersistentType { get { return persistentType; } } ! public object Identifier { get { return identifier; } } ! public override string Message { get { return base.Message + " for " + persistentType.FullName + " instance with identifier: " + identifier; } } --- 8,37 ---- /// versioning). /// </summary> ! [Serializable] ! public class StaleObjectStateException : HibernateException ! { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(StaleObjectStateException)); private System.Type persistentType; private object identifier; ! public StaleObjectStateException(System.Type persistentType, object identifier) : base("Row was updated or deleted by another transaction") ! { this.persistentType = persistentType; this.identifier = identifier; ! log4net.LogManager.GetLogger( typeof(StaleObjectStateException) ).Error("An operation failed due to stale data", this); } ! public System.Type PersistentType ! { get { return persistentType; } } ! public object Identifier ! { get { return identifier; } } ! public override string Message ! { get { return base.Message + " for " + persistentType.FullName + " instance with identifier: " + identifier; } } Index: ADOException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ADOException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ADOException.cs 27 Mar 2003 01:14:25 -0000 1.3 --- ADOException.cs 13 Sep 2004 05:37:37 -0000 1.4 *************** *** 2,18 **** using System.Data; ! namespace NHibernate { /// <summary> /// Wraps an <c>DataException</c>. Indicates that an exception occurred during an ADO.NET call. /// </summary> ! public class ADOException : HibernateException { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(ADOException)); private Exception sqle; public ADOException(DataException root) : this("DataException occurred", root) { } ! public ADOException(string str, Exception root) : base(str, root) { sqle = root; ! log.Error(str, root); } --- 2,21 ---- using System.Data; ! namespace NHibernate ! { /// <summary> /// Wraps an <c>DataException</c>. Indicates that an exception occurred during an ADO.NET call. /// </summary> ! [Serializable] ! public class ADOException : HibernateException ! { private Exception sqle; public ADOException(DataException root) : this("DataException occurred", root) { } ! public ADOException(string str, Exception root) : base(str, root) ! { sqle = root; ! log4net.LogManager.GetLogger( typeof(ADOException) ).Error(str, root); } Index: TransactionException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/TransactionException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TransactionException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- TransactionException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,10 **** using System; ! namespace NHibernate { /// <summary> /// Indicated that a transaction could not be begun, committed, or rolled back /// </summary> ! public class TransactionException : HibernateException { ! public TransactionException(string msg, Exception root) : base(msg, root) {} --- 1,12 ---- using System; ! namespace NHibernate ! { /// <summary> /// Indicated that a transaction could not be begun, committed, or rolled back /// </summary> ! [Serializable] ! public class TransactionException : HibernateException ! { public TransactionException(string msg, Exception root) : base(msg, root) {} Index: ObjectNotFoundException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ObjectNotFoundException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ObjectNotFoundException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- ObjectNotFoundException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,24 **** using System; ! namespace NHibernate { /// <summary> /// Thrown when the user tries to pass a deleted object to the <c>ISession</c>. /// </summary> ! public class ObjectNotFoundException : HibernateException { private object identifier; private System.Type type; ! public ObjectNotFoundException(string msg, object identifier, System.Type type) : base(msg) { this.identifier = identifier; this.type = type; } ! public object Identifier { get { return identifier; } } ! public override string Message { get { return base.Message + ": " + identifier + ", of class: " + type.FullName; } } ! public System.Type Type { get { return type; } } --- 1,34 ---- using System; ! namespace NHibernate ! { /// <summary> /// Thrown when the user tries to pass a deleted object to the <c>ISession</c>. /// </summary> ! [Serializable] ! public class ObjectNotFoundException : HibernateException ! { private object identifier; private System.Type type; ! public ObjectNotFoundException(string msg, object identifier, System.Type type) : base(msg) ! { this.identifier = identifier; this.type = type; } ! ! public object Identifier ! { get { return identifier; } } ! ! public override string Message ! { get { return base.Message + ": " + identifier + ", of class: " + type.FullName; } } ! ! public System.Type Type ! { get { return type; } } Index: MappingException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/MappingException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MappingException.cs 2 Mar 2003 22:15:44 -0000 1.2 --- MappingException.cs 13 Sep 2004 05:37:37 -0000 1.3 *************** *** 1,11 **** using System; ! namespace NHibernate { /// <summary> /// An exception that usually occurs at configuration time, rather than runtime, as a result of /// something screwy in the O-R mappings /// </summary> ! public class MappingException : HibernateException { ! public MappingException(string msg, Exception root) : base(msg, root) {} --- 1,13 ---- using System; ! namespace NHibernate ! { /// <summary> /// An exception that usually occurs at configuration time, rather than runtime, as a result of /// something screwy in the O-R mappings /// </summary> ! [Serializable] ! public class MappingException : HibernateException ! { public MappingException(string msg, Exception root) : base(msg, root) {} Index: AssertionFailure.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/AssertionFailure.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AssertionFailure.cs 17 Feb 2003 18:16:13 -0000 1.1 --- AssertionFailure.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,18 **** using System; ! namespace NHibernate { ! /// <summary> /// Indicates failure of an assertion: a possible bug in NHibernate /// </summary> ! public class AssertionFailure : ApplicationException { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(AssertionFailure)); ! ! public AssertionFailure(string s) : base(s) { ! log.Error("An AssertionFailure occured - this may indicate a bug in NHibernate", this); } ! public AssertionFailure(string s, Exception e) : base(s, e) { ! log.Error("An AssertionFailure occured - this may indicate a bug in NHibernate", e); } } --- 1,20 ---- using System; ! namespace NHibernate ! { /// <summary> /// Indicates failure of an assertion: a possible bug in NHibernate /// </summary> ! [Serializable] ! public class AssertionFailure : ApplicationException ! { ! public AssertionFailure(string s) : base(s) ! { ! log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate", this); } ! public AssertionFailure(string s, Exception e) : base(s, e) ! { ! log4net.LogManager.GetLogger( typeof(AssertionFailure) ).Error("An AssertionFailure occured - this may indicate a bug in NHibernate", e); } } Index: ValidationFailure.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/ValidationFailure.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ValidationFailure.cs 17 Feb 2003 18:16:13 -0000 1.1 --- ValidationFailure.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,12 **** using System; ! namespace NHibernate { ! /// <summary> /// Thrown from <c>IValidatable.Validate()</c> when an invariant was violated. Some applications /// might subclass this exception in order to provide more information about the violation /// </summary> ! public class ValidationFailure : HibernateException { ! public ValidationFailure(string msg) : base(msg) {} --- 1,13 ---- using System; ! namespace NHibernate ! { /// <summary> /// Thrown from <c>IValidatable.Validate()</c> when an invariant was violated. Some applications /// might subclass this exception in order to provide more information about the violation /// </summary> ! [Serializable] ! public class ValidationFailure : HibernateException ! { public ValidationFailure(string msg) : base(msg) {} Index: HibernateException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/HibernateException.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HibernateException.cs 30 Apr 2004 14:06:45 -0000 1.3 --- HibernateException.cs 13 Sep 2004 05:37:37 -0000 1.4 *************** *** 1,5 **** using System; ! namespace NHibernate { /// <summary> --- 1,6 ---- using System; ! namespace NHibernate ! { /// <summary> *************** *** 7,12 **** /// </summary> /// <remarks>Exceptions that occur in the database layer are left as native exceptions</remarks> ! public class HibernateException : ApplicationException { ! public HibernateException(Exception e) : base(String.Empty, e) { } --- 8,14 ---- /// </summary> /// <remarks>Exceptions that occur in the database layer are left as native exceptions</remarks> ! [Serializable] ! public class HibernateException : ApplicationException ! { public HibernateException(Exception e) : base(String.Empty, e) { } Index: TransientObjectException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/TransientObjectException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TransientObjectException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- TransientObjectException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,11 **** using System; ! namespace NHibernate { ! /// <summary> /// Throw when the user passes a transient instance to a <c>ISession</c> method that expects /// a persistent instance /// </summary> ! public class TransientObjectException : HibernateException { public TransientObjectException(string msg): base(msg) { } } --- 1,13 ---- using System; ! namespace NHibernate ! { /// <summary> /// Throw when the user passes a transient instance to a <c>ISession</c> method that expects /// a persistent instance /// </summary> ! [Serializable] ! public class TransientObjectException : HibernateException ! { public TransientObjectException(string msg): base(msg) { } } Index: PropertyNotFoundException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/PropertyNotFoundException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PropertyNotFoundException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- PropertyNotFoundException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,10 **** using System; ! namespace NHibernate { ! /// <summary> /// Indicates that an expected getter or setter method could not be found on a class /// </summary> ! public class PropertyNotFoundException : MappingException { public PropertyNotFoundException(string msg, Exception root) : base(msg, root) {} public PropertyNotFoundException(Exception root) : base(root) {} --- 1,12 ---- using System; ! namespace NHibernate ! { /// <summary> /// Indicates that an expected getter or setter method could not be found on a class /// </summary> ! [Serializable] ! public class PropertyNotFoundException : MappingException ! { public PropertyNotFoundException(string msg, Exception root) : base(msg, root) {} public PropertyNotFoundException(Exception root) : base(root) {} Index: WrongClassException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/WrongClassException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WrongClassException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- WrongClassException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,27 **** using System; ! namespace NHibernate { /// <summary> /// Thrown when <c>ISession.Load()</c> selects a row with the given primary key (identifier value) /// but the row's discriminator value specifies a different subclass from the one requested /// </summary> ! public class WrongClassException : HibernateException { private object identifier; private System.Type type; ! public WrongClassException(string msg, object identifier, System.Type type) : base(msg) { this.identifier = identifier; this.type = type; } ! public object Identifier { get { return identifier; } } ! public System.Type Type { get { return type; } } ! public override string Message { get { return "Object with id: " + identifier --- 1,34 ---- using System; ! namespace NHibernate ! { /// <summary> /// Thrown when <c>ISession.Load()</c> selects a row with the given primary key (identifier value) /// but the row's discriminator value specifies a different subclass from the one requested /// </summary> ! [Serializable] ! public class WrongClassException : HibernateException ! { private object identifier; private System.Type type; ! public WrongClassException(string msg, object identifier, System.Type type) : base(msg) ! { this.identifier = identifier; this.type = type; } ! public object Identifier ! { get { return identifier; } } ! public System.Type Type ! { get { return type; } } ! public override string Message ! { get { return "Object with id: " + identifier Index: QueryException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/QueryException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QueryException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- QueryException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,10 **** using System; ! namespace NHibernate { ! /// <summary> /// A problem occurred translating a Hibernate query to SQL due to invalid query syntax, etc. /// </summary> ! public class QueryException : HibernateException { private string queryString; --- 1,12 ---- using System; ! namespace NHibernate ! { /// <summary> /// A problem occurred translating a Hibernate query to SQL due to invalid query syntax, etc. /// </summary> ! [Serializable] ! public class QueryException : HibernateException ! { private string queryString; *************** *** 15,28 **** public QueryException(Exception e) : base(e) {} ! public string QueryString { get { return queryString; } set { queryString = value; } } ! public override string Message { get { return base.Message + " [" + queryString + "]"; } } - - } } --- 17,30 ---- public QueryException(Exception e) : base(e) {} ! public string QueryString ! { get { return queryString; } set { queryString = value; } } ! public override string Message ! { get { return base.Message + " [" + queryString + "]"; } } } } Index: LazyInitializationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/LazyInitializationException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LazyInitializationException.cs 18 Feb 2003 22:05:51 -0000 1.2 --- LazyInitializationException.cs 13 Sep 2004 05:37:37 -0000 1.3 *************** *** 1,16 **** using System; ! namespace NHibernate { /// <summary> /// A problem occurred trying to lazily initialize a collection or proxy (for example the session /// was closed) or iterate query results. /// </summary> ! public class LazyInitializationException : Exception { ! private static readonly log4net.ILog log = log4net.LogManager.GetLogger(typeof(LazyInitializationException)); ! public LazyInitializationException(Exception root) : base("Hibernate lazy instantiation problem", root) {} ! public LazyInitializationException(string msg) : base(msg) { ! log.Error(msg, this); } --- 1,18 ---- using System; ! namespace NHibernate ! { /// <summary> /// A problem occurred trying to lazily initialize a collection or proxy (for example the session /// was closed) or iterate query results. /// </summary> ! [Serializable] ! public class LazyInitializationException : Exception ! { public LazyInitializationException(Exception root) : base("Hibernate lazy instantiation problem", root) {} ! public LazyInitializationException(string msg) : base(msg) ! { ! log4net.LogManager.GetLogger( typeof(LazyInitializationException) ).Error(msg, this); } Index: InstantiationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/InstantiationException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InstantiationException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- InstantiationException.cs 13 Sep 2004 05:37:37 -0000 1.2 *************** *** 1,18 **** using System; ! namespace NHibernate { /// <summary> /// Thrown if Hibernate can't instantiate an entity or component class at runtime. /// </summary> ! public class InstantiationException : HibernateException { private System.Type type; ! public InstantiationException(string s, System.Type type, Exception root) : base(s, root) { this.type = type; } ! public System.Type PersistentType { get { return type; } } ! public override string Message { get { return base.Message + type.FullName; } } --- 1,26 ---- using System; ! namespace NHibernate ! { /// <summary> /// Thrown if Hibernate can't instantiate an entity or component class at runtime. /// </summary> ! [Serializable] ! public class InstantiationException : HibernateException ! { private System.Type type; ! public InstantiationException(string s, System.Type type, Exception root) : base(s, root) ! { this.type = type; } ! ! public System.Type PersistentType ! { get { return type; } } ! ! public override string Message ! { get { return base.Message + type.FullName; } } |
From: Michael D. <mik...@us...> - 2004-09-13 05:37:47
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30623/NHibernate/Type Modified Files: SerializationException.cs Log Message: NH-99: Marked Exceptions as serializable. Index: SerializationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/SerializationException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SerializationException.cs 28 Feb 2003 22:14:05 -0000 1.2 --- SerializationException.cs 13 Sep 2004 05:37:38 -0000 1.3 *************** *** 1,10 **** using System; ! namespace NHibernate.Type { /// <summary> /// Thrown when a property cannot be serialized/deserialized /// </summary> ! public class SerializationException : HibernateException { ! public SerializationException(string msg, Exception root) : base(msg, root) { } } --- 1,12 ---- using System; ! namespace NHibernate.Type ! { /// <summary> /// Thrown when a property cannot be serialized/deserialized /// </summary> ! [Serializable] ! public class SerializationException : HibernateException ! { public SerializationException(string msg, Exception root) : base(msg, root) { } } |
From: Michael D. <mik...@us...> - 2004-09-13 05:37:46
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30623/NHibernate/Id Modified Files: IdentifierGenerationException.cs Log Message: NH-99: Marked Exceptions as serializable. Index: IdentifierGenerationException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Id/IdentifierGenerationException.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IdentifierGenerationException.cs 28 Mar 2004 06:06:40 -0000 1.2 --- IdentifierGenerationException.cs 13 Sep 2004 05:37:38 -0000 1.3 *************** *** 6,12 **** /// Thrown by <c>IIdentifierGenerator</c> implementation class when ID generation fails /// </summary> public class IdentifierGenerationException : HibernateException { - public IdentifierGenerationException(string msg) : base(msg) {} --- 6,12 ---- /// Thrown by <c>IIdentifierGenerator</c> implementation class when ID generation fails /// </summary> + [Serializable] public class IdentifierGenerationException : HibernateException { public IdentifierGenerationException(string msg) : base(msg) {} |
From: Michael D. <mik...@us...> - 2004-09-13 05:37:46
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30623/NHibernate/Cache Modified Files: CacheException.cs Log Message: NH-99: Marked Exceptions as serializable. Index: CacheException.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cache/CacheException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CacheException.cs 17 Feb 2003 18:16:13 -0000 1.1 --- CacheException.cs 13 Sep 2004 05:37:38 -0000 1.2 *************** *** 1,11 **** using System; ! namespace NHibernate.Cache { ! /// <summary> /// Represents any exception from an <c>ICache</c> /// </summary> ! public class CacheException : HibernateException { ! public CacheException(string s) : base(s) { } --- 1,12 ---- using System; ! namespace NHibernate.Cache ! { /// <summary> /// Represents any exception from an <c>ICache</c> /// </summary> ! [Serializable] ! public class CacheException : HibernateException ! { public CacheException(string s) : base(s) { } |
From: Michael D. <mik...@us...> - 2004-09-13 04:51:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23216/NHibernate/Util Modified Files: ReflectHelper.cs Log Message: Fixed NH-78 with Hql using const fields in classes. If the class is not a mapped class then it needs to be imported so NH can convert the class name to a fully qualified type name. Index: ReflectHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/ReflectHelper.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ReflectHelper.cs 28 Aug 2004 04:57:15 -0000 1.14 --- ReflectHelper.cs 13 Sep 2004 04:51:05 -0000 1.15 *************** *** 77,95 **** } ! public static object GetConstantValue(string name) { ! System.Type clazz; ! try ! { ! clazz = ClassForName( StringHelper.Qualifier(name) ); ! } ! catch(Exception) ! { ! return null; ! } try { ! return clazz.GetProperty( StringHelper.Unqualify(name) ).GetValue(null, new object[0]); ! //?? } catch (Exception) --- 77,95 ---- } ! /// <summary> ! /// Returns the value contained in the static field. ! /// </summary> ! /// <param name="typeName">The name of the <see cref="System.Type"/>.</param> ! /// <param name="fieldName">The name of the Field in the <see cref="System.Type"/>.</param> ! /// <returns>The value contained in that field or <c>null</c> if the Type or Field does not exist.</returns> ! public static object GetConstantValue(string typeName, string fieldName) { ! System.Type clazz = System.Type.GetType( typeName, false ); ! ! if( clazz==null ) return null; ! try { ! return clazz.GetField( fieldName ).GetValue( null ); } catch (Exception) |
From: Michael D. <mik...@us...> - 2004-09-13 04:51:15
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23216/NHibernate/Hql Modified Files: WhereParser.cs QueryTranslator.cs Log Message: Fixed NH-78 with Hql using const fields in classes. If the class is not a mapped class then it needs to be imported so NH can convert the class name to a fully qualified type name. Index: WhereParser.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/WhereParser.cs,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** WhereParser.cs 28 Aug 2004 15:33:56 -0000 1.21 --- WhereParser.cs 13 Sep 2004 04:51:05 -0000 1.22 *************** *** 464,470 **** { object constant; ! if ( token.IndexOf((System.Char) StringHelper.Dot) > - 1 && ! (constant = ReflectHelper.GetConstantValue(token)) != null) { IType type; --- 464,483 ---- { object constant; + string fieldName = null; + string typeName = null; + string importedName = null; ! int indexOfDot = token.IndexOf( (System.Char)StringHelper.Dot ); ! // don't even bother to do the lookups if the indexOfDot is not ! // greater than -1. This will save all the string modifications. ! if( indexOfDot > -1 ) ! { ! fieldName = StringHelper.Unqualify( token ); ! typeName = StringHelper.Qualifier( token ); ! importedName = q.factory.GetImportedClassName( typeName ); ! } ! ! if ( indexOfDot > - 1 && ! (constant = ReflectHelper.GetConstantValue( importedName, fieldName )) != null) { IType type; Index: QueryTranslator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Hql/QueryTranslator.cs,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** QueryTranslator.cs 2 Sep 2004 13:04:58 -0000 1.44 --- QueryTranslator.cs 13 Sep 2004 04:51:05 -0000 1.45 *************** *** 330,334 **** try { ! return (IQueryable) factory.GetPersister( factory.GetImportedClassName( className) ); } catch(Exception) --- 330,334 ---- try { ! return (IQueryable) factory.GetPersister( factory.GetImportedClassName( className ), false ); } catch(Exception) *************** *** 1017,1020 **** --- 1017,1025 ---- } + /// <summary> + /// Gets the Type for the name that might be an Imported Class. + /// </summary> + /// <param name="name">The name that might be an ImportedClass.</param> + /// <returns>A <see cref="System.Type"/> if <c>name</c> is an Imported Class, <c>null</c> otherwise.</returns> internal System.Type GetImportedClass(string name) { *************** *** 1022,1035 **** } private static System.Type GetImportedClass(string name, ISessionFactoryImplementor factory) { ! try ! { ! return ReflectHelper.ClassForName( factory.GetImportedClassName(name) ); ! } ! catch(Exception) ! { ! return null; ! } } --- 1027,1042 ---- } + /// <summary> + /// Gets the Type for the name that might be an Imported Class. + /// </summary> + /// <param name="name">The name that might be an ImportedClass.</param> + /// <param name="factory">The <see cref="ISessionFactoryImplementor"/> that contains the Imported Classes.</param> + /// <returns>A <see cref="System.Type"/> if <c>name</c> is an Imported Class, <c>null</c> otherwise.</returns> private static System.Type GetImportedClass(string name, ISessionFactoryImplementor factory) { ! string importedName = factory.GetImportedClassName( name ); ! ! // don't care about the exception, just give us a null value. ! return System.Type.GetType( importedName, false ); } |
From: Michael D. <mik...@us...> - 2004-09-13 04:51:15
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23216/NHibernate.Test Modified Files: MasterDetailTest.cs Log Message: Fixed NH-78 with Hql using const fields in classes. If the class is not a mapped class then it needs to be imported so NH can convert the class name to a fully qualified type name. Index: MasterDetailTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MasterDetailTest.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MasterDetailTest.cs 31 Aug 2004 08:23:31 -0000 1.14 --- MasterDetailTest.cs 13 Sep 2004 04:51:05 -0000 1.15 *************** *** 652,656 **** [Test] - [Ignore("HQL can't reference static property for const. http://jira.nhibernate.org:8080/browse/NH-78")] public void Categories() { --- 652,655 ---- *************** *** 680,685 **** Assert.IsTrue( enumer.MoveNext() ); s.Close(); - - } --- 679,682 ---- |
From: Michael D. <mik...@us...> - 2004-09-13 04:47:55
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22676/NHibernate/Impl Modified Files: SessionFactoryImpl.cs Log Message: Fixed up interface to GetPersister(string) so it behaives just like h2.0.3 - added an overload to allows the caller to control wether or not throw an exception and instead return null Index: SessionFactoryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/SessionFactoryImpl.cs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** SessionFactoryImpl.cs 31 Aug 2004 13:14:25 -0000 1.29 --- SessionFactoryImpl.cs 13 Sep 2004 04:47:44 -0000 1.30 *************** *** 517,525 **** public IClassPersister GetPersister(string className) { ! //(IClassPersister) was replaced by as IClassPersister result = classPersistersByName[className] as IClassPersister; ! //TODO: not throwing this exception results in a 50% perf gain with hql - not sure ! // where else this code is being used and expecting an exception... ! // if ( result==null) throw new MappingException( "No persister for: " + className ); return result; } --- 517,531 ---- public IClassPersister GetPersister(string className) { ! return GetPersister( className, true ); ! } ! ! public IClassPersister GetPersister(string className, bool throwException) ! { IClassPersister result = classPersistersByName[className] as IClassPersister; ! ! if ( result==null && throwException ) ! { ! throw new MappingException( "No persister for: " + className ); ! } return result; } *************** *** 527,531 **** public IClassPersister GetPersister(System.Type theClass) { - //IClassPersister result = (IClassPersister) classPersisters[theClass]; IClassPersister result = classPersisters[theClass] as IClassPersister; if ( result==null) throw new MappingException( "No persisters for: " + theClass.FullName ); --- 533,536 ---- *************** *** 535,539 **** public CollectionPersister GetCollectionPersister(string role) { - //CollectionPersister result = (CollectionPersister) collectionPersisters[role]; CollectionPersister result = collectionPersisters[role] as CollectionPersister; if ( result==null ) throw new MappingException( "No persisters for collection role: " + role ); --- 540,543 ---- |
From: Michael D. <mik...@us...> - 2004-09-13 04:47:54
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22676/NHibernate/Engine Modified Files: ISessionFactoryImplementor.cs Log Message: Fixed up interface to GetPersister(string) so it behaives just like h2.0.3 - added an overload to allows the caller to control wether or not throw an exception and instead return null Index: ISessionFactoryImplementor.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/ISessionFactoryImplementor.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ISessionFactoryImplementor.cs 31 Aug 2004 13:14:24 -0000 1.8 --- ISessionFactoryImplementor.cs 13 Sep 2004 04:47:45 -0000 1.9 *************** *** 37,45 **** /// Get the persister for the named class /// </summary> ! /// <param name="className"></param> ! /// <returns></returns> IClassPersister GetPersister(string className); /// <summary> /// Get the persister object for a collection role /// </summary> --- 37,55 ---- /// Get the persister for the named class /// </summary> ! /// <param name="className">The name of the class that is persisted.</param> ! /// <returns>The <see cref="IClassPersister"/> for the class.</returns> ! /// <exception cref="MappingException">If no <see cref="IClassPersister"/> can be found.</exception> IClassPersister GetPersister(string className); /// <summary> + /// Get the persister for the named class + /// </summary> + /// <param name="className">The name of the class that is persisted.</param> + /// <param name="throwException"><c>true</c> if the exception should be thrown if no <see cref="IClassPersister"/> is found.</param> + /// <returns>The <see cref="IClassPersister"/> for the class.</returns> + /// <exception cref="MappingException">If no <see cref="IClassPersister"/> can be found and throwException is <c>true</c>.</exception> + IClassPersister GetPersister(string className, bool throwException); + + /// <summary> /// Get the persister object for a collection role /// </summary> |
From: Michael D. <mik...@us...> - 2004-09-11 04:01:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8474/src/NHibernate/SqlCommand Modified Files: SqlBaseBuilder.cs Log Message: Fixing some of the xmldoc problems. Index: SqlBaseBuilder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/SqlCommand/SqlBaseBuilder.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SqlBaseBuilder.cs 10 Feb 2004 18:38:55 -0000 1.1 --- SqlBaseBuilder.cs 10 Sep 2004 21:23:15 -0000 1.2 *************** *** 45,49 **** /// <param name="columnNames">The names of the Columns to Add to the WhereFragment</param> /// <param name="columnValues">The Values for the Columns in the WhereFragment</param> ! /// <param name="op">The operator to use between the names & values. For example " = " or "!="</param> /// <returns>A SqlString that contains the WhereFragment</returns> protected SqlString ToWhereString(string[] columnNames, object[] columnValues, string op) { --- 45,49 ---- /// <param name="columnNames">The names of the Columns to Add to the WhereFragment</param> /// <param name="columnValues">The Values for the Columns in the WhereFragment</param> ! /// <param name="op">The operator to use between the names & values. For example " = " or "!="</param> /// <returns>A SqlString that contains the WhereFragment</returns> protected SqlString ToWhereString(string[] columnNames, object[] columnValues, string op) { *************** *** 57,61 **** /// <param name="columnNames">The names of the Columns to Add to the WhereFragment</param> /// <param name="columnValues">The Values for the Columns in the WhereFragment</param> ! /// <param name="op">The operator to use between the names & values. For example " = " or "!="</param> /// <returns>A SqlString that contains the WhereFragment</returns> protected SqlString ToWhereString(string tableAlias, string[] columnNames, object[] columnValues, string op) { --- 57,61 ---- /// <param name="columnNames">The names of the Columns to Add to the WhereFragment</param> /// <param name="columnValues">The Values for the Columns in the WhereFragment</param> ! /// <param name="op">The operator to use between the names & values. For example " = " or "!="</param> /// <returns>A SqlString that contains the WhereFragment</returns> protected SqlString ToWhereString(string tableAlias, string[] columnNames, object[] columnValues, string op) { |
From: Michael D. <mik...@us...> - 2004-09-11 02:29:49
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9306/src/NHibernate/Type Modified Files: DateTimeType.cs Log Message: Fixing some of the xmldoc problems. Index: DateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateTimeType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** DateTimeType.cs 9 Sep 2004 21:17:46 -0000 1.8 --- DateTimeType.cs 10 Sep 2004 21:27:00 -0000 1.9 *************** *** 8,12 **** /// <summary> ! /// Maps a System.DateTime Property to a column that stores date & time down to /// the accuracy of a second. /// </summary> --- 8,12 ---- /// <summary> ! /// Maps a System.DateTime Property to a column that stores date & time down to /// the accuracy of a second. /// </summary> *************** *** 92,95 **** --- 92,96 ---- } + public override bool HasNiceEquals { |