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-07-26 12:38:21
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28792/NHibernate Modified Files: nhibernate-configuration-2.0.xsd Log Message: Change attribute name from "jar" to "assembly" and added documentation to schema about combinations. Index: nhibernate-configuration-2.0.xsd =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/nhibernate-configuration-2.0.xsd,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** nhibernate-configuration-2.0.xsd 12 Jul 2004 02:26:29 -0000 1.2 --- nhibernate-configuration-2.0.xsd 26 Jul 2004 12:38:09 -0000 1.3 *************** *** 46,53 **** </xs:element> <xs:element name='mapping'> <xs:complexType> <xs:attribute name='resource' /> <xs:attribute name='file' /> ! <xs:attribute name='jar' /> </xs:complexType> </xs:element> --- 46,61 ---- </xs:element> <xs:element name='mapping'> + <xs:annotation> + <xs:documentation> + There are 3 possible combinations of mapping attributes + 1 - resource & assembly: NHibernate will read the mapping resource from the specified assembly + 2 - file only: NHibernate will read the mapping from the file. + 3 - assembly only: NHibernate will find all the resources ending in hbm.xml from the assembly. + </xs:documentation> + </xs:annotation> <xs:complexType> <xs:attribute name='resource' /> <xs:attribute name='file' /> ! <xs:attribute name='assembly' /> </xs:complexType> </xs:element> |
From: Michael D. <mik...@us...> - 2004-07-25 11:49:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1894 Modified Files: CodeGenerator.cs Log Message: modified name of exe in DOMConfigurator Index: CodeGenerator.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net/CodeGenerator.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CodeGenerator.cs 25 Jul 2004 11:41:03 -0000 1.1 --- CodeGenerator.cs 25 Jul 2004 11:49:39 -0000 1.2 *************** *** 25,29 **** System.IO.File.Delete("error-log.txt"); ! log4net.Config.DOMConfigurator.Configure(new System.IO.FileInfo("hbm2net.exe.config")); if (args.Length == 0) --- 25,29 ---- System.IO.File.Delete("error-log.txt"); ! log4net.Config.DOMConfigurator.Configure(new System.IO.FileInfo("NHibernate.Tool.hbm2net.exe.config")); if (args.Length == 0) |
From: Michael D. <mik...@us...> - 2004-07-25 11:48:18
|
Update of /cvsroot/nhibernate/nhibernate/external-bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1573 Added Files: Commons.dll Commons.xml NAnt.Core.dll NAnt.Core.xml NVelocity.dll NVelocity.xml Log Message: Added libraries that hbm2net and Tasks depend on. --- NEW FILE: NVelocity.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: NVelocity.xml --- <?xml version="1.0"?> <doc> <assembly> <name>NVelocity</name> </assembly> <members> <member name="T:NVelocity.App.Events.EventCartridge"> <summary> 'Package' of event handlers... * </summary> <author> <a href="mailto:ge...@op...">Geir Magnusson Jr.</a> </author> <author> <a href="mailto:j_a...@ya...">Jose Alberto Fernandez</a> </author> <version> $Id: NVelocity.xml,v 1.1 2004/07/25 11:48:08 mikedoerfler Exp $ </version> </member> <member name="T:NVelocity.App.Events.ReferenceInsertionEventHandler"> [...6744 lines suppressed...] <summary> The AST node structure is merged with the context to produce the final output. * Throws IOException if failure is due to a file related issue, and Exception otherwise * </summary> <param name="context">Conext with data elements accessed by template </param> <param name="writer">output writer for rendered template @throws ResourceNotFoundException if template not found from any available source. @throws ParseErrorException if template cannot be parsed due to syntax (or other) error. @throws Exception anything else. </param> </member> </members> </doc> --- NEW FILE: NAnt.Core.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Commons.xml --- <?xml version="1.0"?> <doc> <assembly> <name>Commons</name> </assembly> <members> <member name="T:Commons.Collections.CollectionsUtil"> <summary> Static utility methods for collections </summary> </member> <!-- Badly formed XML comment ignored for member "T:Commons.Collections.ExtendedProperties" --> <member name="F:Commons.Collections.ExtendedProperties.defaults"> <summary> Default configurations repository. </summary> </member> <member name="F:Commons.Collections.ExtendedProperties.file"> <summary> The file connected to this repository (holding comments and such). * @serial </summary> </member> <member name="F:Commons.Collections.ExtendedProperties.basePath"> <summary> Base path of the configuration file used to create this ExtendedProperties object. </summary> </member> <member name="F:Commons.Collections.ExtendedProperties.fileSeparator"> <summary> File separator. </summary> </member> <member name="F:Commons.Collections.ExtendedProperties.isInitialized"> <summary> Has this configuration been intialized. </summary> </member> <member name="F:Commons.Collections.ExtendedProperties.include"> <summary> This is the name of the property that can point to other properties file for including other properties files. </summary> </member> <member name="F:Commons.Collections.ExtendedProperties.keysAsListed"> <summary> These are the keys in the order they listed in the configuration file. This is useful when you wish to perform operations with configuration information in a particular order. </summary> </member> <member name="M:Commons.Collections.ExtendedProperties.#ctor"> <summary> Creates an empty extended properties object. </summary> </member> <member name="M:Commons.Collections.ExtendedProperties.#ctor(System.String)"> <summary> Creates and loads the extended properties from the specified file. * </summary> <param name="file">A String. </param> <exception cref="!:">IOException. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.#ctor(System.String,System.String)"> <summary> Creates and loads the extended properties from the specified file. * </summary> <param name="file">A String. </param> <exception cref="!:">IOException. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.Init(Commons.Collections.ExtendedProperties)"> <summary> Private initializer method that sets up the generic resources. * </summary> <exception cref="!:">IOException, if there was an I/O problem. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.IsInitialized"> <summary> Indicate to client code whether property resources have been initialized or not. </summary> </member> <member name="M:Commons.Collections.ExtendedProperties.Load(System.IO.Stream)"> <summary> Load the properties from the given input stream. * </summary> <param name="input">An InputStream. </param> <exception cref="!:">IOException. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.Load(System.IO.Stream,System.String)"> <summary> Load the properties from the given input stream and using the specified encoding. * </summary> <param name="input">An InputStream. </param> <param name="enc">An encoding. </param> <exception cref="!:">IOException. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetProperty(System.String)"> <summary> Gets a property from the configuration. * </summary> <param name="key">property to retrieve </param> <returns>value as object. Will return user value if exists, if not then default value if exists, otherwise null </returns> </member> <member name="M:Commons.Collections.ExtendedProperties.AddProperty(System.String,System.Object)"> <summary> Add a property to the configuration. If it already exists then the value stated here will be added to the configuration entry. For example, if * resource.loader = file * is already present in the configuration and you * addProperty("resource.loader", "classpath") * Then you will end up with a Vector like the following: * ["file", "classpath"] * </summary> <param name="String">key </param> <param name="String">value </param> </member> <member name="M:Commons.Collections.ExtendedProperties.AddPropertyDirect(System.String,System.Object)"> <summary> Adds a key/value pair to the map. This routine does no magic morphing. It ensures the keylist is maintained * </summary> <param name="key">key to use for mapping </param> <param name="obj">object to store </param> </member> <member name="M:Commons.Collections.ExtendedProperties.AddStringProperty(System.String,System.String)"> <summary> Sets a string property w/o checking for commas - used internally when a property has been broken up into strings that could contain escaped commas to prevent the inadvertant vectorization. Thanks to Leon Messerschmidt for this one. </summary> </member> <member name="M:Commons.Collections.ExtendedProperties.SetProperty(System.String,System.Object)"> <summary> Set a property, this will replace any previously set values. Set values is implicitly a call to clearProperty(key), addProperty(key,value). </summary> <param name="String">key </param> <param name="String">value </param> </member> <member name="M:Commons.Collections.ExtendedProperties.Save(System.IO.TextWriter,System.String)"> <summary> Save the properties to the given outputstream. </summary> <param name="output">An OutputStream. </param> <param name="header">A String. </param> <exception cref="!:">IOException. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.Combine(Commons.Collections.ExtendedProperties)"> <summary> Combines an existing Hashtable with this Hashtable. * Warning: It will overwrite previous entries without warning. * </summary> <param name="">ExtendedProperties </param> </member> <member name="M:Commons.Collections.ExtendedProperties.ClearProperty(System.String)"> <summary> Clear a property in the configuration. * </summary> <param name="String">key to remove along with corresponding value. </param> </member> <member name="M:Commons.Collections.ExtendedProperties.GetKeys(System.String)"> <summary> Get the list of the keys contained in the configuration repository that match the specified prefix. * </summary> <param name="prefix">The prefix to test against. </param> <returns>An Iterator of keys that match the prefix. </returns> </member> <member name="M:Commons.Collections.ExtendedProperties.Subset(System.String)"> <summary> Create an ExtendedProperties object that is a subset of this one. Take into account duplicate keys by using the setProperty() in ExtendedProperties. * </summary> <param name="String">prefix </param> </member> <member name="M:Commons.Collections.ExtendedProperties.ToString"> <summary> Display the configuration for debugging purposes. </summary> </member> <member name="M:Commons.Collections.ExtendedProperties.GetString(System.String)"> <summary> Get a string associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated string. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a String. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetString(System.String,System.String)"> <summary> Get a string associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated string if key is found, default value otherwise. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a String. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetProperties(System.String)"> <summary> Get a list of properties associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated properties if key is found. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a String/Vector. </exception> <exception cref="!:">IllegalArgumentException if one of the tokens is malformed (does not contain an equals sign). </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetProperties(System.String,System.Collections.Hashtable)"> <summary> Get a list of properties associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated properties if key is found. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a String/Vector. </exception> <exception cref="!:">IllegalArgumentException if one of the tokens is malformed (does not contain an equals sign). </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetStringArray(System.String)"> <summary> Get an array of strings associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated string array if key is found. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a String/Vector. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetVector(System.String)"> <summary> Get a Vector of strings associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated Vector. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Vector. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetVector(System.String,System.Collections.ArrayList)"> <summary> Get a Vector of strings associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated Vector. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Vector. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetBoolean(System.String)"> <summary> Get a boolean associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated boolean. </returns> <exception cref="!:">NoSuchElementException is thrown if the key doesn't map to an existing object. </exception> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Boolean. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetBoolean(System.String,System.Boolean)"> <summary> Get a boolean associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated boolean if key is found and has valid format, default value otherwise. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Boolean. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.TestBoolean(System.String)"> <summary> Test whether the string represent by value maps to a boolean value or not. We will allow <code>true</code>, <code>on</code>, and <code>yes</code> for a <code>true</code> boolean value, and <code>false</code>, <code>off</code>, and <code>no</code> for <code>false</code> boolean values. Case of value to test for boolean status is ignored. * </summary> <param name="String">The value to test for boolean state. </param> <returns><code>true</code> or <code>false</code> if the supplied text maps to a boolean value, or <code>null</code> otherwise. </returns> </member> <member name="M:Commons.Collections.ExtendedProperties.GetByte(System.String)"> <summary> Get a byte associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated byte. </returns> <exception cref="!:">NoSuchElementException is thrown if the key doesn't map to an existing object. </exception> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Byte. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetByte(System.String,System.SByte)"> <summary> Get a byte associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated byte. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Byte. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetByte(System.String,System.Byte)"> <summary> Get a byte associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated byte if key is found and has valid format, default value otherwise. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Byte. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetShort(System.String)"> <summary> Get a short associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated short. </returns> <exception cref="!:">NoSuchElementException is thrown if the key doesn't map to an existing object. </exception> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Short. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetShort(System.String,System.Int16)"> <summary> Get a short associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated short if key is found and has valid format, default value otherwise. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Short. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetInt(System.String)"> <summary> The purpose of this method is to get the configuration resource with the given name as an integer. * </summary> <param name="name">The resource name. </param> <returns>The value of the resource as an integer. </returns> </member> <member name="M:Commons.Collections.ExtendedProperties.GetInt(System.String,System.Int32)"> <summary> The purpose of this method is to get the configuration resource with the given name as an integer, or a default value. * </summary> <param name="name">The resource name </param> <param name="def">The default value of the resource. </param> <returns>The value of the resource as an integer. </returns> </member> <member name="M:Commons.Collections.ExtendedProperties.GetInteger(System.String)"> <summary> Get a int associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated int. </returns> <exception cref="!:">NoSuchElementException is thrown if the key doesn't map to an existing object. </exception> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Integer. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetInteger(System.String,System.Int32)"> <summary> Get a int associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated int if key is found and has valid format, default value otherwise. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Integer. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetLong(System.String)"> <summary> Get a long associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated long. </returns> <exception cref="!:">NoSuchElementException is thrown if the key doesn't map to an existing object. </exception> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Long. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetLong(System.String,System.Int64)"> <summary> Get a long associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated long if key is found and has valid format, default value otherwise. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Long. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetFloat(System.String)"> <summary> Get a float associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated float. </returns> <exception cref="!:">NoSuchElementException is thrown if the key doesn't map to an existing object. </exception> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Float. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetFloat(System.String,System.Single)"> <summary> Get a float associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated float if key is found and has valid format, default value otherwise. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Float. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetDouble(System.String)"> <summary> Get a double associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <returns>The associated double. </returns> <exception cref="!:">NoSuchElementException is thrown if the key doesn't map to an existing object. </exception> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Double. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.GetDouble(System.String,System.Double)"> <summary> Get a double associated with the given configuration key. * </summary> <param name="key">The configuration key. </param> <param name="defaultValue">The default value. </param> <returns>The associated double if key is found and has valid format, default value otherwise. </returns> <exception cref="!:">ClassCastException is thrown if the key maps to an object that is not a Double. </exception> <exception cref="!:">NumberFormatException is thrown if the value mapped by the key has not a valid number format. </exception> </member> <member name="M:Commons.Collections.ExtendedProperties.ConvertProperties(Commons.Collections.ExtendedProperties)"> <summary> Convert a standard properties class into a configuration class. * </summary> <param name="p">properties object to convert into a ExtendedProperties object. * </param> <returns>ExtendedProperties configuration created from the properties object. </returns> </member> <member name="T:Commons.Collections.PropertiesReader"> <summary> This class is used to read properties lines. These lines do not terminate with new-line chars but rather when there is no backslash sign a the end of the line. This is used to concatenate multiple lines for readability. </summary> </member> <member name="M:Commons.Collections.PropertiesReader.#ctor(System.IO.StreamReader)"> <summary> Constructor. </summary> <param name="reader">A Reader.</param> </member> <member name="M:Commons.Collections.PropertiesReader.ReadProperty"> <summary> Read a property. </summary> <returns>A String.</returns> </member> <member name="T:Commons.Collections.PropertiesTokenizer"> <summary> This class divides into tokens a property value. Token separator is "," but commas into the property value are escaped using the backslash in front. </summary> </member> <member name="F:Commons.Collections.PropertiesTokenizer.DELIMITER"> <summary> The property delimiter used while parsing (a comma). </summary> </member> <member name="M:Commons.Collections.PropertiesTokenizer.#ctor(System.String)"> <summary> Constructor. </summary> <param name="string">A String</param> </member> <member name="M:Commons.Collections.PropertiesTokenizer.HasMoreTokens"> <summary> Check whether the object has more tokens. </summary> <returns>True if the object has more tokens. </returns> </member> <member name="M:Commons.Collections.PropertiesTokenizer.NextToken"> <summary> Get next token. </summary> <returns>A String</returns> </member> </members> </doc> --- NEW FILE: Commons.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: NAnt.Core.xml --- <?xml version="1.0"?> <doc> <assembly> <name>NAnt.Core</name> </assembly> <members> <member name="T:NAnt.Core.Attributes.BooleanValidatorAttribute"> <summary> Used to indicate that a property should be able to be converted into a <see cref="T:System.Boolean"/>. </summary> </member> <member name="T:NAnt.Core.Attributes.ValidatorAttribute"> <summary> Base class for all validator attributes. </summary> </member> <member name="M:NAnt.Core.Attributes.ValidatorAttribute.Validate(System.Object)"> <summary> [...8955 lines suppressed...] </member> <member name="P:NAnt.Core.XmlLogger.Threshold"> <summary> Gets or sets the highest level of message this logger should respond to. </summary> <value>The highest level of message this logger should respond to.</value> <remarks> Only messages with a message level higher than or equal to the given level should be written to the log. </remarks> </member> <member name="P:NAnt.Core.XmlLogger.OutputWriter"> <summary> Gets or sets the <see cref="T:System.IO.TextWriter"/> to which the logger is to send its output. </summary> </member> </members> </doc> |
From: Michael D. <mik...@us...> - 2004-07-25 11:46:15
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1459 Modified Files: NHibernateSolution.build Log Message: added targets for hbm2net, Tasks, and examples. Added their dependencies to bin folder Index: NHibernateSolution.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/NHibernateSolution.build,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NHibernateSolution.build 23 Jul 2004 14:23:31 -0000 1.7 --- NHibernateSolution.build 25 Jul 2004 11:46:05 -0000 1.8 *************** *** 46,50 **** </target> ! <target name="build-external" depends="init" description="Builds code that NHibernate depends on but is not a core peice of NHibernate. The built dll/exes will be distributed in the external-bin folder so there should be no need for a user to build it."> <nant buildfile="src/HashCodeProvider/HashCodeProvider.build" --- 46,54 ---- </target> ! <target ! name="build-external" ! depends="init" ! description="Builds code that NHibernate depends on but is not a core peice of NHibernate. The built dll/exes will be distributed in the external-bin folder so there should be no need for a user to build it." ! > <nant buildfile="src/HashCodeProvider/HashCodeProvider.build" *************** *** 65,71 **** <fileset basedir="external-bin"> <includes name="log4net.*" /> <includes name="DotNetMock.*" /> <includes name="nunit.framework.*" /> ! <includes name="HashCodeProvider.*" /> </fileset> </copy> --- 69,78 ---- <fileset basedir="external-bin"> <includes name="log4net.*" /> + <includes name="HashCodeProvider.*" /> <includes name="DotNetMock.*" /> <includes name="nunit.framework.*" /> ! <includes name="Commons.*" /> ! <includes name="NVelocity.*" /> ! <includes name="NAnt.Core.*" /> </fileset> </copy> *************** *** 86,90 **** target="build" /> ! </target> --- 93,108 ---- target="build" /> ! <nant ! buildfile="src/NHibernate.Tool.hbm2net/NHibernate.Tool.hbm2net.build" ! target="build" ! /> ! <nant ! buildfile="src/NHibernate.Tasks/NHibernate.Tasks.build" ! target="build" ! /> ! <nant ! buildfile="src/NHibernate.Examples/NHibernate.Examples.build" ! target="build" ! /> </target> |
From: Michael D. <mik...@us...> - 2004-07-25 11:44:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1256/src/NHibernate.Test Modified Files: NHibernate.Test.build Log Message: minor mod to references element inside of csc element Index: NHibernate.Test.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test.build,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NHibernate.Test.build 23 Jul 2004 15:46:32 -0000 1.5 --- NHibernate.Test.build 25 Jul 2004 11:44:42 -0000 1.6 *************** *** 6,10 **** xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" > ! <target name="build"> --- 6,16 ---- 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 ! --> ! <target name="build"> *************** *** 16,29 **** > ! <references> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> ! <includes name="${build.dir}/bin/DotNetMock.dll" /> ! <includes name="${build.dir}/bin/DotNetMock.Framework.dll" /> ! <includes name="${build.dir}/bin/log4net.dll" /> ! <includes name="${build.dir}/bin/nunit.framework.dll"/> ! <includes name="${build.dir}/bin/NHibernate.DomainModel.dll" /> ! <includes name="${build.dir}/bin/NHibernate.dll" /> </references> --- 22,35 ---- > ! <references basedir="${build.dir}/bin"> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> ! <includes name="DotNetMock.dll" /> ! <includes name="DotNetMock.Framework.dll" /> ! <includes name="log4net.dll" /> ! <includes name="NHibernate.DomainModel.dll" /> ! <includes name="NHibernate.dll" /> ! <includes name="nunit.framework.dll"/> </references> *************** *** 35,39 **** <copy file="App.config" ! tofile="${build.dir}/bin/NHibernate.Test.dll.config" /> <copy --- 41,45 ---- <copy file="App.config" ! tofile="${build.dir}/bin/${nant.project.name}.dll.config" /> <copy *************** *** 50,55 **** <target name="test"> <nunit2> ! <formatter type="Xml" usefile="true" extension=".xml" outputdir="${build.dir}/bin" /> ! <test assemblyname="${build.dir}/bin/NHibernate.Test.dll" appconfig="${build.dir}/bin/NHibernate.Test.dll.config" /> </nunit2> </target> --- 56,69 ---- <target name="test"> <nunit2> ! <formatter ! type="Xml" ! usefile="true" ! extension=".xml" ! outputdir="${build.dir}/bin" ! /> ! <test ! assemblyname="${build.dir}/bin/${nant.project.name}.dll" ! appconfig="${build.dir}/bin/${nant.project.name}.dll.config" ! /> </nunit2> </target> |
From: Michael D. <mik...@us...> - 2004-07-25 11:44:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1216/src/NHibernate.DomainModel Modified Files: NHibernate.DomainModel.build Log Message: minor mod to references element inside of csc element Index: NHibernate.DomainModel.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/NHibernate.DomainModel.build,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NHibernate.DomainModel.build 14 May 2004 12:08:57 -0000 1.2 --- NHibernate.DomainModel.build 25 Jul 2004 11:44:08 -0000 1.3 *************** *** 22,30 **** > ! <references> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> ! <includes name="${build.dir}/bin/NHibernate.dll" /> </references> --- 22,30 ---- > ! <references basedir="${build.dir}/bin"> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> ! <includes name="NHibernate.dll" /> </references> |
From: Michael D. <mik...@us...> - 2004-07-25 11:43:02
|
Update of /cvsroot/nhibernate/nhibernate/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv935/src Modified Files: NHibernate-1.1.sln Log Message: Added a hbm2net Tasks projects to solution. Index: NHibernate-1.1.sln =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate-1.1.sln,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NHibernate-1.1.sln 15 Feb 2004 22:53:33 -0000 1.2 --- NHibernate-1.1.sln 25 Jul 2004 11:42:49 -0000 1.3 *************** *** 12,15 **** --- 12,23 ---- EndProjectSection EndProject + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Tool.hbm2net-1.1", "NHibernate.Tool.hbm2net\NHibernate.Tool.hbm2net-1.1.csproj", "{136FFE16-EE3B-4556-90FB-E265113CB13F}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection + EndProject + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Tasks-1.1", "NHibernate.Tasks\NHibernate.Tasks-1.1.csproj", "{C6F085E3-17FA-424A-9A09-143F3E177FEB}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection + EndProject Global GlobalSection(SolutionConfiguration) = preSolution *************** *** 30,33 **** --- 38,49 ---- {E3482030-5828-4112-9906-D4C5153DCE3F}.Release.ActiveCfg = Release|.NET {E3482030-5828-4112-9906-D4C5153DCE3F}.Release.Build.0 = Release|.NET + {136FFE16-EE3B-4556-90FB-E265113CB13F}.Debug.ActiveCfg = Debug|.NET + {136FFE16-EE3B-4556-90FB-E265113CB13F}.Debug.Build.0 = Debug|.NET + {136FFE16-EE3B-4556-90FB-E265113CB13F}.Release.ActiveCfg = Release|.NET + {136FFE16-EE3B-4556-90FB-E265113CB13F}.Release.Build.0 = Release|.NET + {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Debug.ActiveCfg = Debug|.NET + {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Debug.Build.0 = Debug|.NET + {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Release.ActiveCfg = Release|.NET + {C6F085E3-17FA-424A-9A09-143F3E177FEB}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution |
From: Michael D. <mik...@us...> - 2004-07-25 11:41:48
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tasks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv656/src/NHibernate.Tasks Added Files: AssemblyInfo.cs Hbm2NetTask.cs NHibernate.Tasks-1.1.csproj NHibernate.Tasks.build Log Message: Initial add of NAnt tasks to run hbm2net in the NHibernate Toolset. --- NEW FILE: NHibernate.Tasks-1.1.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{C6F085E3-17FA-424A-9A09-143F3E177FEB}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "NHibernate.Tasks" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "NHibernate.Tasks" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "false" OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.XML" HintPath = "..\..\..\..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> <Reference Name = "NHibernate-1.1" Project = "{0D8B57B0-1310-4EF0-B50C-DD22F37310C7}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> <Reference Name = "log4net" AssemblyName = "log4net" HintPath = "..\..\external-bin\log4net.dll" /> <Reference Name = "NAnt.Core" AssemblyName = "NAnt.Core" HintPath = "..\..\external-bin\NAnt.Core.dll" /> </References> </Build> <Files> <Include> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Hbm2NetTask.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "NHibernate.Tasks.build" BuildAction = "None" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: AssemblyInfo.cs --- using System.Reflection; using System.Runtime.CompilerServices; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified, the assembly is not signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. KeyFile refers to a file which contains // a key. // (*) If the KeyFile and the KeyName values are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP, that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the KeyFile is installed into the CSP and used. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // When specifying the KeyFile, the location of the KeyFile should be // relative to the project output directory which is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is // located in the project directory, you would specify the AssemblyKeyFile // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] --- NEW FILE: NHibernate.Tasks.build --- <project name="NHibernate.Tasks" 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 --> <target name="build" description="NAnt Tasks that use NHibernate's Toolset."> <csc output="${build.dir}/bin/${nant.project.name}.dll" define="${current.build.defines}" target="library" debug="${build.debug}" doc="${build.dir}/bin/${nant.project.name}.xml" nowarn="1591" verbose="true" > <sources failonempty="true"> <includes name="*.cs" /> </sources> <references basedir="${build.dir}/bin"> <includes name="System.dll" /> <includes name="DotNetMock.dll" /> <includes name="NHibernate.dll" /> <includes name="NAnt.Core.dll" /> <includes name="log4net.dll" /> </references> </csc> </target> </project> --- NEW FILE: Hbm2NetTask.cs --- using System; using System.Collections; using System.IO; using System.Text; using NAnt.Core; using NAnt.Core.Types; using NAnt.Core.Tasks; using NAnt.Core.Attributes; namespace NHibernate.Tasks { [TaskName("hbm2net")] public class Hbm2NetTask : ExternalProgramBase { FileSet _set = new FileSet(); string _output = null; string _config = null; string _args = null; [BuildElement("fileset", Required=true)] public FileSet Hbm2NetFileSet { get { return _set; } set { _set = value; } } [TaskAttribute("output")] public string Output { get { return _output; } set { _output = value; } } [TaskAttribute("config")] public string Config { get { return _config; } set { _config = value; } } public override string ExeName { get { string asm = this.GetType().Assembly.Location; string basename = asm.Substring(0, asm.LastIndexOf(Path.DirectorySeparatorChar)+1); return basename + "NHibernate.Tool.hbm2net.exe"; } } public override string ProgramArguments { get { return _args; } } protected override void ExecuteTask() { StringBuilder sb = new StringBuilder(); if(_output != null) { sb.Append("--output=" + _output + " "); } if(_config != null) { sb.Append("--config=" + _config + " "); } foreach(string filename in _set.FileNames) { sb.Append(filename + " "); } _args = sb.ToString(); base.ExecuteTask(); } } } |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv582/src/NHibernate.Tool.hbm2net Added Files: .cvsignore AbstractRenderer.cs App.config AssemblyInfo.cs BasicRenderer.cs ClassMapping.cs ClassName.cs CodeGenerator.cs convert.vm DOMRenderer.cs FieldProperty.cs FinderRenderer.cs Generator.cs JavaTool.cs MappingElement.cs MetaAttributeHelper.cs MethodSignatureBuilder.cs NHibernate.Tool.hbm2net-1.1.csproj NHibernate.Tool.hbm2net.build QueryBuilder.cs Renderer.cs StringResourceLoader.cs SupportClass.cs VelocityRenderer.cs Log Message: Initial add of hbm2net to NHibernate Toolset. --- NEW FILE: Renderer.cs --- 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> /// <param name="savedToPackage">what package is this class placed in /// </param> /// <param name="savedToClass">what classname does it really get /// </param> /// <param name="classMapping">what classmapping is this for /// </param> /// <param name="class2classmap">A complete map from classname to the classmapping /// </param> /// <param name="writer">where we want the output /// @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. /// /// </summary> /// <param name="classMapping">The class mapping of the generated class /// </param> /// <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. /// /// </summary> /// <param name="classMapping">The class mapping of the generated class /// </param> /// <returns> the class name the class should be saved to /// </returns> System.String getSaveToClassName(ClassMapping classMapping); } } --- NEW FILE: MetaAttributeHelper.cs --- using System; using StringHelper = NHibernate.Util.StringHelper; using MultiHashMap = System.Collections.Hashtable; using MultiMap = System.Collections.Hashtable; using Element = System.Xml.XmlElement; namespace NHibernate.Tool.hbm2net { /// <summary> Helper for loading, merging and accessing <meta> tags. /// /// </summary> /// <author> max /// /// /// </author> public class MetaAttributeHelper { 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; this.inheritable = inherit; } public override System.String ToString() { return value_Renamed; } } /// <summary> Load meta attributes from jdom element into a MultiMap. /// /// </summary> /// <param name="">element /// </param> /// <returns> MultiMap /// </returns> static protected internal MultiMap loadMetaMap(Element element) { MultiMap result = new MultiHashMap(); SupportClass.ListCollectionSupport metaAttributeList = new SupportClass.ListCollectionSupport(); metaAttributeList.AddAll(element.SelectNodes("meta", CodeGenerator.nsmgr)); 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{} } MetaAttribute ma = new MetaAttribute(value_Renamed, inherit); if (result[attribute] == null) result[attribute] = new SupportClass.ListCollectionSupport(); ((SupportClass.ListCollectionSupport)result[attribute]).Add(ma); } return result; } /// <summary> Merges a Multimap with inherited maps. /// Values specified always overrules/replaces the inherited values. /// /// </summary> /// <param name="">local /// </param> /// <param name="">inherited /// </param> /// <returns> a MultiMap with all values from local and extra values /// from inherited /// </returns> static public MultiMap mergeMetaMaps(MultiMap local, MultiMap inherited) { MultiHashMap result = new MultiHashMap(); SupportClass.PutAll(result, local); 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; if (element.inheritable) { if (result[key] == null) result[key] = new SupportClass.ListCollectionSupport(); ((SupportClass.ListCollectionSupport)result[key]).Add(element); } } } } } return result; } /// <summary> Method loadAndMergeMetaMap.</summary> /// <param name="">classElement /// </param> /// <param name="">inheritedMeta /// </param> /// <returns> MultiMap /// </returns> public static MultiMap loadAndMergeMetaMap(Element classElement, MultiMap inheritedMeta) { return mergeMetaMaps(loadMetaMap(classElement), inheritedMeta); } /// <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) first = false; else buf.Append(seperator); buf.Append(iter.Current); } return buf.ToString(); } internal static bool getMetaAsBool(SupportClass.ListCollectionSupport c, bool defaultValue) { if (c == null || c.IsEmpty()) { return defaultValue; } else { try { //return System.Boolean.Parse(c.GetEnumerator().Current.ToString()); return Convert.ToBoolean(c[0].ToString()); } catch{} return defaultValue; } } internal static System.String getMetaAsString(SupportClass.ListCollectionSupport c) { if (c == null || c.IsEmpty()) { return string.Empty; } 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()); } return sb.ToString(); } } } } --- NEW FILE: FinderRenderer.cs --- using System; namespace NHibernate.Tool.hbm2net { /// <summary> <p>Title: Basic Finder Generator for Hibernate 2</p> /// <p>Description: Generate basic finders for hibernate properties. /// This requires two things in the hbm.xml files. /// /// The first is an indication of which fields you want to generate finders for. /// You indicate that with a meta block inside a property tag such as /// /// <property name="name" column="name" type="string"> /// <meta attribute="finder-method">findByName</meta> /// </property> /// /// The finder method name will be the text enclosed in the meta tags. /// /// If you want to generate a finder based on a join you can do something like this: /// /// <set name="games" inverse="true" lazy="true" table="GamePlayers"> /// <meta attribute="foreign-finder-name">findSavedGames</meta> /// <meta attribute="foreign-finder-field">save</meta> /// <meta attribute="foreign-join-field">players</meta> /// <key column="playerID"/> /// <many-to-many class="com.whatever.Game" column="gameID"/> /// </set> /// /// Where foreign-finder-name will be the name of the finder when generated, foreign-finder-field is the field in /// the foreign class that you will want as a paramter to the finder (the criteria in the query) and foreign-join-field /// is the field in teh foreign class that joins to this object (in case there are more than one collection of these /// objects in the foreign class). /// /// After you've defined your finders, the second thing to do is to create a config file for hbm2net of the format: /// /// <codegen> /// <generate renderer="NHibernate.Tool.hbm2net.BasicRenderer"/> /// <generate suffix="Finder" renderer="NHibernate.Tool.hbm2net.FinderRenderer"/> /// </codegen> /// /// And then use the param to hbm2net --config=xxx.xml where xxx.xml is the config file you /// just created. /// /// An optional parameter is meta tag at the class level of the format: /// /// <meta attribute="session-method">com.whatever.SessionTable.getSessionTable().getSession();</meta> /// /// Which would be the way in which you get sessions if you use the Thread Local Session pattern /// like I do. /// </p> /// <p>Copyright: Copyright (c) 2003</p> /// </summary> /// <author> Matt Hall (matt2k(at)users.sf.net) /// </author> /// <author> Max Rydahl Andersen (small adjustments and bugfixes) /// </author> /// <version> 1.0 /// </version> public class FinderRenderer:AbstractRenderer { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public FinderRenderer() { InitBlock(); } private void InitBlock() { object tempObject; 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"; hibType["byte"] = "Hibernate.BYTE"; tempObject3 = "Hibernate.SHORT"; hibType["short"] = "Hibernate.SHORT"; tempObject4 = "Hibernate.INTEGER"; hibType["int"] = tempObject4; tempObject5 = "Hibernate.LONG"; hibType["long"] = tempObject5; tempObject6 = "Hibernate.INTEGER"; hibType["Integer"] = tempObject6; tempObject7 = "Hibernate.BOOLEAN"; hibType["boolean"] = tempObject7; tempObject8 = "Hibernate.FLOAT"; hibType["float"] = tempObject8; object tempObject9; 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"; /// <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) { genPackageDelaration(savedToPackage, classMapping, mainwriter); mainwriter.WriteLine(); // 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); // always implements Serializable writer.Write(" implements Serializable"); writer.WriteLine(" {"); writer.WriteLine(); // 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); propWriter.WriteLine("}"); writer.Write(propWriter.ToString()); // finally write the imports doImports(classMapping, mainwriter); mainwriter.Write(writer.ToString()); } /// <summary> Create finders for properties that have the <meta atttribute="finder-method"> /// finderName</meta> block defined. Also, create a findAll(Session) method. /// /// </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"' FieldProperty field = (FieldProperty) fields.Current; if (field.getMeta(MT_FINDERMETHOD) != null) { System.String finderName = field.getMetaAsString(MT_FINDERMETHOD); if ("".Equals(sessionMethod)) { // Make the method signature require a session to be passed in writer.WriteLine(" public static List " + finderName + "(Session session, " + JavaTool.getTrueTypeName(field, class2classmap) + " " + field.FieldName + ") " + "throws SQLException, HibernateException {"); } else { // Use the session method to get the session to execute the query writer.WriteLine(" public static List " + finderName + "(" + JavaTool.getTrueTypeName(field, class2classmap) + " " + field.FieldName + ") " + "throws SQLException, HibernateException {"); writer.WriteLine(" Session session = " + sessionMethod); } writer.WriteLine(" List finds = session.find(\"from " + classMapping.FullyQualifiedName + " as " + classMapping.Name.ToLower() + " where " + classMapping.Name.ToLower() + "." + field.FieldName + "=?\", " + getFieldAsObject(false, field) + ", " + getFieldAsHibernateType(false, field) + ");"); writer.WriteLine(" return finds;"); writer.WriteLine(" }"); writer.WriteLine(); } 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 QueryBuilder qb = new QueryBuilder(); qb.LocalClass = classMapping; qb.setForeignClass(field.ForeignClass, class2classmap, 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"' ClassMapping foreignClass = (ClassMapping) class2classmap[field.ForeignClass.FullyQualifiedName]; if (foreignClass == null) { // Can't find the class, return log.Error("Could not find the class " + field.ForeignClass.Name); return ; } 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"' FieldProperty f = (FieldProperty) foreignFields.Current; if (f.FieldName.Equals(fieldName)) { foreignField = f; } } if (foreignField != null) { qb.addCritera(foreignClass, foreignField, "="); } else { // Can't find the field, return log.Error("Could not find the field " + fieldName + " that was supposed to be in class " + field.ForeignClass.Name); return ; } MethodSignatureBuilder msb = new MethodSignatureBuilder(finderName, "List", "public static"); if ("".Equals(sessionMethod)) { // Make the method signature require a session to be passed in msb.addParam("Session session"); /* writer.println(" public static List " + finderName + "(Session session, " + getTrueTypeName(foreignField, class2classmap) + " " + foreignField.getName() + ") " + "throws SQLException, HibernateException {");*/ } else { // Use the session method to get the session to execute the query /* writer.println(" public static List " + finderName + "(" + getTrueTypeName(foreignField, class2classmap) + " " + foreignField.getName() + ") " + "throws SQLException, HibernateException {"); writer.println(" Session session = " + sessionMethod);*/ } // Always need the object we're basing the query on msb.addParam(classMapping.Name + " " + classMapping.Name.ToLower()); // And the foreign class field msb.addParam(JavaTool.getTrueTypeName(foreignField, class2classmap) + " " + foreignField.FieldName); msb.addThrows("SQLException"); msb.addThrows("HibernateException"); writer.WriteLine(" " + msb.buildMethodSignature()); if (!"".Equals(sessionMethod)) { writer.WriteLine(" Session session = " + sessionMethod); } writer.WriteLine(" List finds = session.find(\"" + qb.Query + "\", " + qb.ParamsAsString + ", " + qb.ParamTypesAsString + ");"); writer.WriteLine(" return finds;"); writer.WriteLine(" }"); writer.WriteLine(); } } // Create the findAll() method if ("".Equals(sessionMethod)) { writer.WriteLine(" public static List findAll" + "(Session session) " + "throws SQLException, HibernateException {"); } else { writer.WriteLine(" public static List findAll() " + "throws SQLException, HibernateException {"); writer.WriteLine(" Session session = " + sessionMethod); } writer.WriteLine(" List finds = session.find(\"from " + classMapping.Name + " in class " + classMapping.PackageName + "." + classMapping.Name + "\");"); writer.WriteLine(" return finds;"); writer.WriteLine(" }"); writer.WriteLine(); } //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; /// <summary> Generate the imports for the finder class. /// /// </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. /* classMapping.getImports().add("java.io.Serializable"); for (Iterator imports = classMapping.getImports().iterator(); imports.hasNext(); ) { writer.println("import " + imports.next() + ";"); }*/ // Imports for finders writer.WriteLine("import java.io.Serializable;"); writer.WriteLine("import java.util.List;"); writer.WriteLine("import java.sql.SQLException;"); writer.WriteLine(); // * import is bad style. But better than importing classing that we don't necesarrily uses... writer.WriteLine("import NHibernate.*;"); writer.WriteLine("import NHibernate.type.Type;"); // writer.println("import NHibernate.Hibernate;"); // writer.println("import NHibernate.HibernateException;"); writer.WriteLine(); } /// <summary> Gets the fieldAsObject attribute of the FinderRenderer object /// /// </summary> /// <param name="">prependThis /// </param> /// <param name="">field /// </param> /// <returns> /// </returns> public static System.String getFieldAsObject(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; if (type != null && type.Primitive && !type.Array) { //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.":""); return typeName + field.FieldName + " )"; } return field.FieldName; } /// <summary> Coversion map for field types to Hibernate types, might be good to move /// this to some other more general class /// </summary> //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; /// <summary> Return the hibernate type string for the given field /// /// </summary> /// <param name="">prependThis /// </param> /// <param name="">field /// </param> /// <returns> /// </returns> public static System.String getFieldAsHibernateType(bool prependThis, FieldProperty field) { ClassName type = field.ClassType; //UPGRADE_TODO: Method 'java.util.Map.get' was converted to 'System.Collections.IDictionary.Item' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javautilMapget_javalangObject"' System.String hibTypeString = (System.String) hibType[type.Name]; if ((System.Object) hibTypeString != null) { return hibTypeString; } else { return "Hibernate.OBJECT"; } } static FinderRenderer() { primitiveToObject = new System.Collections.Hashtable(); hibType = new System.Collections.Hashtable(); } } } --- NEW FILE: CodeGenerator.cs --- using System; using MappingException = NHibernate.MappingException; using MultiHashMap = System.Collections.Hashtable; using MultiMap = System.Collections.Hashtable; using Document = System.Xml.XmlDocument; using Element = System.Xml.XmlElement; namespace NHibernate.Tool.hbm2net { /// <summary> </summary> 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("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(); MultiMap globalMetas = new MultiHashMap(); // parse command line parameters for (int i = 0; i < args.Length; i++) { if (args[i].StartsWith("--")) { if (args[i].StartsWith("--config=")) { // 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()) { generators.Add(new Generator((Element) generateElements.Current)); } } else if (args[i].StartsWith("--output=")) { outputDir = args[i].Substring(9); } } else { mappingFiles.Add(args[i]); } } // if no config xml file, add a default generator if (generators.Count == 0) { generators.Add(new Generator()); } System.Collections.Hashtable classMappings = new System.Collections.Hashtable(); for (System.Collections.IEnumerator iter = mappingFiles.GetEnumerator(); iter.MoveNext(); ) { try { 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"]; if (rootElement == null) continue; System.Xml.XmlAttribute a = rootElement.Attributes["package"]; System.String pkg = null; if (a != null) { pkg = a.Value; } 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); classElements = rootElement.SelectNodes("urn:subclass", nsmgr).GetEnumerator(); handleClass(pkg, me, classMappings, classElements, mm, true); classElements = rootElement.SelectNodes("urn:joined-subclass", nsmgr).GetEnumerator(); handleClass(pkg, me, classMappings, classElements, mm, true); } catch(Exception exc) { log.Error("Error in map",exc); } } // generate source files for (System.Collections.IEnumerator iterator = generators.GetEnumerator(); iterator.MoveNext(); ) { Generator g = (Generator) iterator.Current; g.BaseDirName = outputDir; g.generate(classMappings); } } catch (System.Exception e) { SupportClass.WriteStackTrace(e, Console.Error); } } private static void handleClass(System.String classPackage, MappingElement me, System.Collections.Hashtable classMappings, System.Collections.IEnumerator classElements, MultiMap mm, bool extendz) { while (classElements.MoveNext()) { Element clazz = (Element) classElements.Current; if (!extendz) { ClassMapping cmap = new ClassMapping(classPackage, clazz, me, mm); SupportClass.PutElement(classMappings, cmap.FullyQualifiedName, cmap); } 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 + ">"); } ClassMapping superclass = (ClassMapping) classMappings[ex]; if (superclass == null) { throw new MappingException("Cannot extend unmapped class " + ex); } ClassMapping subclassMapping = new ClassMapping(classPackage, me, superclass.ClassName, superclass, clazz, mm); superclass.addSubClass(subclassMapping); } } } } } --- NEW FILE: Generator.cs --- 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() { suffix = string.Empty; prefix = string.Empty; } virtual public System.String BaseDirName { get { return baseDirName; } set { if ((System.Object) value != null) { this.baseDirName = value; } } } 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> public Generator() { InitBlock(); } /// <summary> Constructs a new Generator, configured from XML.</summary> public Generator(Element generateElement) { 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; } // set packageName field this.packageName = (generateElement.Attributes["package"] == null?null:generateElement.Attributes["package"].Value); // set prefix if ((System.Object) (value_Renamed = (generateElement.Attributes["prefix"] == null?null:generateElement.Attributes["prefix"].Value)) != null) { this.prefix = value_Renamed; } // set suffix if ((System.Object) (value_Renamed = (generateElement.Attributes["suffix"] == null?null:generateElement.Attributes["suffix"].Value)) != null) { this.suffix = value_Renamed; } // set extension if ((System.Object) (value_Renamed = (generateElement.Attributes["extension"] == null?null:generateElement.Attributes["extension"].Value)) != null) { this.extension = value_Renamed; } // set lowerFirstLetter value_Renamed = (generateElement.Attributes["lowerFirstLetter"] == null?null:generateElement.Attributes["lowerFirstLetter"].Value); try { this.lowerFirstLetter = System.Boolean.Parse(value_Renamed); } catch{} System.Collections.IEnumerator iter = generateElement.SelectNodes("param").GetEnumerator(); while (iter.MoveNext()) { Element childNode = (Element) iter.Current; params_Renamed[childNode.Attributes["name"].Value] = childNode.InnerText; } } /// <summary> </summary> public virtual void generate(System.Collections.IDictionary classMappingsCol) { log.Info("Generating " + classMappingsCol.Count + " in " + BaseDirName); Renderer renderer = (Renderer) SupportClass.CreateNewInstance(System.Type.GetType(this.rendererClass)); /// <summary>Configure renderer </summary> renderer.configure(params_Renamed); /// <summary>Running through actual classes </summary> for (System.Collections.IEnumerator classMappings = classMappingsCol.Values.GetEnumerator(); classMappings.MoveNext(); ) { ClassMapping classMapping = (ClassMapping) classMappings.Current; writeRecur(classMapping, classMappingsCol, renderer); } /// <summary>Running through components </summary> for (System.Collections.IEnumerator cmpMappings = ClassMapping.Components; cmpMappings.MoveNext(); ) { ClassMapping mapping = (ClassMapping) cmpMappings.Current; write(mapping, classMappingsCol, renderer); } } private void writeRecur(ClassMapping classMapping, System.Collections.IDictionary class2classmap, Renderer renderer) { write(classMapping, class2classmap, renderer); if (!(classMapping.Subclasses.Count == 0)) { System.Collections.IEnumerator it = classMapping.Subclasses.GetEnumerator(); while (it.MoveNext()) { writeRecur((ClassMapping) it.Current, class2classmap, renderer); } } } /// <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); writer.Close(); } /// <summary> </summary> private System.String getFileName(System.String className) { return this.getName(className) + "." + this.extension; } /// <summary> </summary> private System.String getName(System.String className) { System.String name = null; if (this.lowerFirstLetter) { name = className.Substring(0, (1) - (0)).ToLower() + className.Substring(1, (className.Length) - (1)); } else { name = className; } return this.prefix + name + this.suffix; } private System.String getPackageName(System.String packageName) { if ((System.Object) this.packageName == null) { return (System.Object) packageName == null?string.Empty:packageName; } else { return this.packageName; } } /// <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); } } return dir; } } } --- NEW FILE: BasicRenderer.cs --- using System; using StringHelper = NHibernate.Util.StringHelper; namespace NHibernate.Tool.hbm2net { public class BasicRenderer:AbstractRenderer { private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); public BasicRenderer() { InitBlock(); } private void InitBlock() { javaTool = new JavaTool(); primitiveToObject["char"] = "Character"; primitiveToObject["byte"] = "Byte"; primitiveToObject["short"] = "Short"; primitiveToObject["int"] = "Integer"; primitiveToObject["long"] = "Long"; primitiveToObject["boolean"] = "Boolean"; primitiveToObject["float"] = "Float"; primitiveToObject["double"] = "Double"; } protected internal const int ORDINARY = 0; protected internal const int BOUND = 1; protected internal const int CONSTRAINT = 3; //any constraint properties are bound as well internal JavaTool javaTool; public override void render(System.String savedToPackage, System.String savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StreamWriter mainwriter) { mainwriter.WriteLine("using System;"); mainwriter.WriteLine(@"//------------------------------------------------------------------------------ // <autogenerated> // This code was generated by a tool. // Runtime Version: {0} // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </autogenerated> //------------------------------------------------------------------------------ ",Guid.Empty.GetType().Assembly.ImageRuntimeVersion); genPackageDelaration(savedToPackage, classMapping, mainwriter); mainwriter.WriteLine("{"); // 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(); // class declaration if (classMapping.getMeta("class-description") == null) { writer.WriteLine(@" /// <summary> /// POJO for {0} /// </summary> /// <remark> /// This class is autogenerated /// </remark> ", classMapping.ClassName); } else { writer.WriteLine("/// <summary>\n" + javaTool.toJavaDoc(classMapping.getMetaAsString("class-description"), 0) + "\n/// </summary>"); } System.String classScope = classMapping.Scope; System.String declarationType = classMapping.DeclarationType; //classMapping.addImport(typeof(System.Runtime.Serialization.ISerializable)); //String modifiers = classMapping.getModifiers(); if (classMapping.shouldBeAbstract() && (classScope.IndexOf("abstract") == - 1)) { writer.Write("abstract " + classScope + " " + declarationType + " " + savedToClass); } else { writer.Write(classScope + " " + declarationType + " " + savedToClass); } if (javaTool.hasExtends(classMapping) || javaTool.hasImplements(classMapping)) { writer.Write(" : "); } if (javaTool.hasExtends(classMapping)) { writer.Write(javaTool.getExtends(classMapping)); } if (javaTool.hasExtends(classMapping) && javaTool.hasImplements(classMapping)) { writer.Write(", "); } if (javaTool.hasImplements(classMapping)) { writer.Write(javaTool.getImplements(classMapping)); } writer.WriteLine(" {"); writer.WriteLine(); // switch to another writer to be able to insert the // veto- and changeSupport fields System.IO.StringWriter propWriter = new System.IO.StringWriter(); if (!classMapping.Interface) { doFields(classMapping, class2classmap, propWriter); doConstructors(savedToClass, classMapping, class2classmap, propWriter); } System.String vetoSupport = makeSupportField("vetos", classMapping.AllFields); System.String changeSupport = makeSupportField("changes", classMapping.AllFields); int fieldTypes = doFieldAccessors(classMapping, class2classmap, propWriter, vetoSupport, changeSupport); if (!classMapping.Interface) { doSupportMethods(fieldTypes, vetoSupport, changeSupport, propWriter); doToString(classMapping, propWriter); doEqualsAndHashCode(savedToClass, classMapping, propWriter); } if (classMapping.getMeta("class-code") != null) { propWriter.WriteLine("// The following is extra code specified in the hbm.xml files"); SupportClass.ListCollectionSupport extras = classMapping.getMeta("class-code"); System.Collections.IEnumerator iter = extras.GetEnumerator(); while (iter.MoveNext()) { System.String code = iter.Current.ToString(); propWriter.WriteLine(code); } propWriter.WriteLine("// end of extra code specified in the hbm.xml files"); } propWriter.WriteLine("}"); //insert change and VetoSupport if (!classMapping.Interface) { doSupports(fieldTypes, classMapping, vetoSupport, changeSupport, writer); } writer.Write(propWriter.ToString()); // finally write the imports doImports(classMapping, mainwriter); mainwriter.Write(writer.ToString()); mainwriter.WriteLine("\n}"); } /// <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) { if ((fieldTypes & CONSTRAINT) == CONSTRAINT) { writer.WriteLine(" public void addVetoableChangeListener( VetoableChangeListener l ) {"); writer.WriteLine(" " + vetoSupport + ".addVetoableChangeListener(l);"); writer.WriteLine(" }"); writer.WriteLine(" public void removeVetoableChangeListener( VetoableChangeListener l ) {"); writer.WriteLine(" " + vetoSupport + ".removeVetoableChangeListener(l);"); writer.WriteLine(" }"); writer.WriteLine(); } if ((fieldTypes & BOUND) == BOUND) { writer.WriteLine(" public void addPropertyChangeListener( PropertyChangeListener l ) {"); writer.WriteLine(" " + changeSupport + ".addPropertyChangeListener(l);"); writer.WriteLine(" }"); writer.WriteLine(" public void removePropertyChangeListener( PropertyChangeListener l ) {"); writer.WriteLine(" " + changeSupport + ".removePropertyChangeListener(l);"); writer.WriteLine(" }"); writer.WriteLine(); } } /// <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) { if ((fieldTypes & CONSTRAINT) == CONSTRAINT) { writer.WriteLine(" private VetoableChangeSupport " + vetoSupport + " = new VetoableChangeSupport(this);"); writer.WriteLine(); } if ((fieldTypes & BOUND) == BOUND) { writer.WriteLine(" private PropertyChangeSupport " + changeSupport + " = new PropertyChangeSupport(this);"); writer.WriteLine(); } } public virtual void doConstructors(System.String savedToClass, ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer) { // full constructor SupportClass.ListCollectionSupport allFieldsForFullConstructor = classMapping.AllFieldsForFullConstructor; writer.WriteLine(" /// <summary>\n /// full constructor\n /// </summary>"); System.String fullCons = " public " + savedToClass + StringHelper.OpenParen; fullCons += javaTool.fieldsAsParameters(allFieldsForFullConstructor, classMapping, class2classmap); writer.Write(fullCons + ")"); //invoke super to initialize superclass... SupportClass.ListCollectionSupport supersConstructorFields = classMapping.FieldsForSupersFullConstructor; if (!(supersConstructorFields.Count == 0)) { writer.Write(" : base("); bool first = true; for (System.Collections.IEnumerator fields = supersConstructorFields.GetEnumerator(); fields.MoveNext(); ) { if (first) first = false; else writer.Write(", "); FieldProperty field = (FieldProperty) fields.Current; writer.Write(field.FieldName); } writer.Write(")"); } writer.WriteLine(); writer.WriteLine(" {"); // initialisation of localfields for (System.Collections.IEnumerator fields = classMapping.LocalFieldsForFullConstructor.GetEnumerator(); fields.MoveNext(); ) { FieldProperty field = (FieldProperty) fields.Current; if (field.GeneratedAsProperty) { writer.WriteLine(" this." + field.FieldName + " = " + field.FieldName + ";"); } } writer.WriteLine(" }"); writer.WriteLine(); // no args constructor (if fullconstructor had any arguments!) if (allFieldsForFullConstructor.Count > 0) { writer.WriteLine(" /// <summary>\n /// default constructor\n /// </summary>"); writer.WriteLine(" public " + savedToClass + "() {"); writer.WriteLine(" }"); writer.WriteLine(); } // minimal constructor (only if the fullconstructor had any arguments) if ((allFieldsForFullConstructor.Count > 0) && classMapping.needsMinimalConstructor()) { SupportClass.ListCollectionSupport allFieldsForMinimalConstructor = classMapping.AllFieldsForMinimalConstructor; writer.WriteLine(" /// <summary>\n /// minimal constructor\n /// </summary>"); System.String minCons = " public " + savedToClass + "("; bool first = true; for (System.Collections.IEnumerator fields = allFieldsForMinimalConstructor.GetEnumerator(); fields.MoveNext(); ) { if (first) first = false; else minCons = minCons + ", "; FieldProperty field = (FieldProperty) fields.Current; minCons = minCons + JavaTool.shortenType(JavaTool.getTrueTypeName(field, class2classmap), classMapping.Imports) + " " + field.FieldName; } writer.Write(minCons + ")"); // invoke super to initialize superclass... SupportClass.ListCollectionSupport supersMinConstructorFields = classMapping.FieldsForSupersMinimalConstructor; if (!(supersMinConstructorFields.Count == 0)) { writer.Write(" : base("); bool first2 = true; for (System.Collections.IEnumerator fields = supersMinConstructorFields.GetEnumerator(); fields.MoveNext(); ) { if (first2) first2 = false; else writer.Write(StringHelper.CommaSpace); FieldProperty field = (FieldProperty) fields.Current; writer.Write(field.FieldName); } writer.Write(")"); } writer.WriteLine(); writer.WriteLine(" {"); // initialisation of localfields for (System.Collections.IEnumerator fields = classMapping.LocalFieldsForMinimalConstructor.GetEnumerator(); fields.MoveNext(); ) { FieldProperty field = (FieldProperty) fields.Current; if (field.GeneratedAsProperty) { writer.WriteLine(" this." + field.FieldName + " = " + field.FieldName + ";"); } } writer.WriteLine(" }"); writer.WriteLine(); } } public virtual void doFields(ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer) { // fields if (!classMapping.Interface) { if (classMapping.SuperInterface) { doFields(classMapping.AllFields, classMapping.Imports, class2classmap, writer); } } SupportClass.ListCollectionSupport fieldList = classMapping.Fields; SupportClass.SetSupport imports = classMapping.Imports; doFields(fieldList, imports, class2classmap, writer); } private void doFields(SupportClass.ListCollectionSupport fieldList, SupportClass.SetSupport imports, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer) { for (System.Collections.IEnumerator fields = fieldList.GetEnumerator(); fields.MoveNext(); ) { FieldProperty field = (FieldProperty) fields.Current; if (field.GeneratedAsProperty) { System.String fieldScope = getFieldScope(field, "scope-field", "private"); writer.WriteLine(" /// <summary>\n /// Holder for " + (field.Nullable && !field.Identifier?"nullable ":string.Empty) + (field.Identifier?"identifier":"persistent") + " field " + field.FieldName + "\n /// </summary>"); writer.Write(" " + fieldScope + " " + field.FullyQualifiedTypeName + " " + field.fieldcase); if (field.getMeta("default-value") != null) { writer.Write(" = " + field.getMetaAsString("default-value")); } writer.WriteLine(';'); } writer.WriteLine(); } } public virtual void doEqualsAndHashCode(System.String savedToClass, ClassMapping classMapping, System.IO.StringWriter writer) { if (classMapping.mustImplementEquals()) { writer.WriteLine(" public override bool Equals(object obj) {"); writer.WriteLine(" if(this == obj) return true;"); writer.WriteLine(" if((obj == null) || (obj.GetType() != this.GetType())) return false;"); writer.WriteLine(" " + savedToClass + " castObj = (" + savedToClass + ") obj;"); writer.Write(" return (castObj != null) "); int usedFields = 0; SupportClass.ListCollectionSupport idFields = new SupportClass.ListCollectionSupport(); for (System.Collections.IEnumerator fields = classMapping.Fields.GetEnumerator(); fields.MoveNext(); ) { FieldProperty field = (FieldProperty) fields.Current; if (field.getMetaAsBool("use-in-equals")) { writer.Write(" && (this." + field.fieldcase + " == castObj." + field.fieldcase + ")"); usedFields++; } if (field.Identifier) { idFields.Add(field); } } if (usedFields == 0) { log.Warn("No properties has been marked as being used in equals/hashcode for " + classMapping.Name + ". Using object identifier which is RARELY safe to use! See http://hibernate.org/109.html"); for (System.Collections.IEnumerator fields = idFields.GetEnumerator(); fields.MoveNext(); ) { FieldProperty field = (FieldProperty) fields.Current; writer.Write(" && (this." + field.fieldcase + " == castObj." + field.fieldcase + ")"); } } writer.WriteLine(";"); writer.WriteLine(" }"); writer.WriteLine(); writer.WriteLine(" public override int GetHashCode() {"); writer.WriteLine(" int hash = 69;"); //writer.Write(" return"); for (System.Collections.IEnumerator fields = classMapping.Fields.GetEnumerator(); fields.MoveNext(); ) { FieldProperty field = (FieldProperty) fields.Current; if (field.getMetaAsBool("use-in-equals")) { //writer.Write("\n " + field.FieldName + ".GetHashCode() ^"); writer.WriteLine(" hash = 31 * hash + " + field.fieldcase + ".GetHashCode();"); } } if (usedFields == 0) { for (System.Collections.IEnumerator fields = idFields.GetEnumerator(); fields.MoveNext(); ) { FieldProperty field = (FieldProperty) fields.Current; //writer.Write("\n " + field.FieldName + ".GetHashCode() ^"); writer.WriteLine(" hash = 31 * hash + " + field.fieldcase + ".GetHashCode();"); } } //writer.WriteLine(" 0;"); writer.WriteLine(" return hash;"); writer.WriteLine(" }"); writer.WriteLine(); } } public virtual void doToString(ClassMapping classMapping, System.IO.StringWriter writer) { writer.WriteLine(" public override string ToString()"); writer.WriteLine(" {"); writer.WriteLine(" System.Text.StringBuilder sb = new System.Text.StringBuilder();"); for (System.Collections.IEnumerator fields = classMapping.AllFields.GetEnumerator(); fields.MoveNext(); ) { FieldProperty field = (FieldProperty) fields.Current; // If nothing is stated about id then include it in toString() if (field.Identifier && field.getMeta("use-in-tostring") == null) { writer.WriteLine(" sb.AppendFormat(\"{0}={{0}} \", {0});", field.fieldcase); } else if (field.getMetaAsBool("use-in-tostring")) { writer.WriteLine(" sb.AppendFormat(\"{0}={{0}} \", {0});", field.fieldcase); } } writer.WriteLine(" return sb.ToString();"); writer.WriteLine(" }"); writer.WriteLine(); } internal static System.Collections.IDictionary primitiveToObject; public virtual int doFieldAccessors(ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer, System.String vetoSupport, System.String changeSupport) { int fieldTypes = ORDINARY; if (classMapping.SuperInterface) { fieldTypes = doFields(classMapping, class2classmap, writer, vetoSupport, changeSupport, fieldTypes, classMapping.AllFields); } SupportClass.ListCollectionSupport fieldz = classMapping.Fields; fieldTypes = doFields(classMapping, class2classmap, writer, vetoSupport, changeSupport, fieldTypes, fieldz); return fieldTypes; } private int doFields(ClassMapping classMapping, System.Collections.IDictionary class2classmap, System.IO.StringWriter writer, System.String vetoSupport, System.String changeSupport, int fieldTypes, SupportClass.ListCollectionSupport fieldz) { // field accessors for (System.Collections.IEnumerator fields = fieldz.GetEnumerator(); fields.MoveNext(); ) { FieldProperty field = (FieldProperty) fields.Current; if (field.GeneratedAsProperty) { // getter System.String getAccessScope = getFieldScope(field, "scope-get", "public"); if (field.getMeta("field-description") != null) { //writer.WriteLine(" /** \n" + javaTool.toJavaDoc(field.getMetaAsString("field-description"), 4) + " */"); writer.WriteLine(" /// <summary>\n" + javaTool.toJavaDoc(field.getMetaAsString("field-description"), 4) + "\n /// </summary>"); } writer.Write(" " + getAccessScope + " " + field.FullyQualifiedTypeName + " " + field.propcase); if (classMapping.Interface) { writer.WriteLine(";"); } else { writer.WriteLine(); writer.WriteLine(" {"); writer.WriteLine(" get { return this." + field.fieldcase + "; }"); //writer.WriteLine(" {"); //writer.WriteLine(" return this." + field.FieldName + ";"); //writer.WriteLine(" }"); } // setter int fieldType = 0; if (field.getMeta("beans-property-type") != null) { System.String beansPropertyType = field.getMetaAsString("beans-property-type").Trim().ToLower(); if (beansPropertyType.Equals("constraint")) { fieldTypes = (fieldTypes | CONSTRAINT); fieldType = CONSTRAINT; } else if (beansPropertyType.Equals("bound")) { fieldTypes = (fieldTypes | BOUND); fieldType = BOUND; } } System.String setAccessScope = getFieldScope(field, "scope-set", "public"); writer.Write(" set"); writer.Write((fieldType & CONSTRAINT) == CONSTRAINT?" throws PropertyVetoException ":""); if (classMapping.Interface) { writer.WriteLine(";"); } else { writer.WriteLine(); writer.WriteLine(" {"); if ((fieldType & CONSTRAINT) == CONSTRAINT || (fieldType & BOUND) == BOUND) { writer.WriteLine(" Object oldValue = " + getFieldAsObject(true, field) + ";"); } if ((fieldType & CONSTRAINT) == CONSTRAINT) { writer.WriteLine(" " + vetoSupport + ".fireVetoableChange(\"" + field.fieldcase + "\","); writer.WriteLine(" oldValue,"); writer.WriteLine(" " + getFieldAsObject(false, field) + ");"); } writer.WriteLine(" this." + field.fieldcase + " = value;"); if ((fieldType & BOUND) == BOUND) { writer.WriteLine(" " + changeSupport + ".firePropertyChange(\"" + field.fieldcase + "\","); writer.WriteLine(" oldValue,"); writer.WriteLine(" " + getFieldAsObject(false, field) + ");"); } writer.WriteLine(" }"); } writer.WriteLine(" }"); writer.WriteLine(); // add/remove'rs (commented out for now) /* if(field.getForeignClass()!=null) { ClassName foreignClass = field.getForeignClass(); String trueforeign = getTrueTypeName(foreignClass, class2classmap); classMapping.addImport(trueforeign); // Try to identify the matching set method on the child. ClassMapping forignMap = (ClassMapping) class2classmap.get(foreignClass.getFullyQualifiedName()); if(forignMap!=null) { Iterator foreignFields = forignMap.getFields().iterator(); while (foreignFields.hasNext()) { Field ffield = (Field) foreignFields.next(); if(ffield.isIdentifier()) { log.Debug("Trying to match " + ffield.getName() + " with " + field.getForeignKeys()); } } } else { log.Error("Could not find foreign class's mapping - cannot provide bidirectional setters!"); } String addAccessScope = getFieldScope(field, "scope", "scope-add"); writer.println(" " + setAccessScope + " void add" + field.getAsSuffix() + StringHelper.OPEN + shortenType(trueforeign, classMapping.getImports()) + " a" + field.getName() + ") {"); writer.println(" this." + getterType + field.getAsSuffix() + "().add(a" + field.getName() + ");"); writer.println(" a" + field.getName() + ".setXXX(this);"); writer.println(" }"); writer.println(); } */ } } return fieldTypes; } public virtual void doImports(ClassMapping classMapping, System.IO.StreamWriter writer) { writer.WriteLine(javaTool.genImports(cla... [truncated message content] |
From: Michael D. <mik...@us...> - 2004-07-25 11:39:01
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32749/NHibernate.Tool.hbm2net Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Tool.hbm2net added to the repository |
From: Michael D. <mik...@us...> - 2004-07-25 11:38:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Tasks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32612/NHibernate.Tasks Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Tasks added to the repository |
From: Michael D. <mik...@us...> - 2004-07-24 20:52:52
|
Update of /cvsroot/nhibernate/nhibernate/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23617 Added Files: NHibernate.Examples-1.1.sln Log Message: Adding solution file that contains only Examples and NHibernate into cvs. --- NEW FILE: NHibernate.Examples-1.1.sln --- Microsoft Visual Studio Solution File, Format Version 8.00 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate.Examples-1.1", "NHibernate.Examples\NHibernate.Examples-1.1.csproj", "{D3C5C767-240B-4E4A-B4FA-ED0B6BAE5D54}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate-1.1", "NHibernate\NHibernate-1.1.csproj", "{EE3B9473-7C64-44FF-B342-91B558D413A8}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {D3C5C767-240B-4E4A-B4FA-ED0B6BAE5D54}.Debug.ActiveCfg = Debug|.NET {D3C5C767-240B-4E4A-B4FA-ED0B6BAE5D54}.Debug.Build.0 = Debug|.NET {D3C5C767-240B-4E4A-B4FA-ED0B6BAE5D54}.Release.ActiveCfg = Release|.NET {D3C5C767-240B-4E4A-B4FA-ED0B6BAE5D54}.Release.Build.0 = Release|.NET {EE3B9473-7C64-44FF-B342-91B558D413A8}.Debug.ActiveCfg = Debug|.NET {EE3B9473-7C64-44FF-B342-91B558D413A8}.Debug.Build.0 = Debug|.NET {EE3B9473-7C64-44FF-B342-91B558D413A8}.Release.ActiveCfg = Release|.NET {EE3B9473-7C64-44FF-B342-91B558D413A8}.Release.Build.0 = Release|.NET EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal |
From: Michael D. <mik...@us...> - 2004-07-24 20:52:01
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/QuickStart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23374/QuickStart Added Files: User.cs User.hbm.xml UserFixture.cs Log Message: Adding examples into cvs. --- NEW FILE: User.cs --- using System; namespace NHibernate.Examples.QuickStart { /// <summary> /// Summary description for User. /// </summary> public class User { private string id; private string userName; private string password; private string emailAddress; private DateTime lastLogon; public User() { } public string Id { get { return id; } set { id = value; } } public string UserName { get { return userName; } set { userName = value; } } public string Password { get { return password; } set { password = value; } } public string EmailAddress { get { return emailAddress; } set { emailAddress = value; } } public DateTime LastLogon { get { return lastLogon; } set { lastLogon = value; } } } } --- NEW FILE: User.hbm.xml --- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.Examples.QuickStart.User, NHibernate.Examples" table="users"> <id name="Id" column="LogonId" type="String(20)"> <generator class="assigned" /> </id> <property name="UserName" column="Name" type="String(40)"/> <property name="Password" type="String(20)"/> <property name="EmailAddress" type="String(40)"/> <property name="LastLogon" type="DateTime"/> </class> </hibernate-mapping> --- NEW FILE: UserFixture.cs --- using System; using System.Collections; using NHibernate.Cfg; using NUnit.Framework; namespace NHibernate.Examples.QuickStart { /// <summary> /// Summary description for UserFixture. /// </summary> [TestFixture] public class UserFixture { [Test] public void ValidateQuickStart() { Configuration cfg = new Configuration(); cfg.AddAssembly("NHibernate.Examples"); ISessionFactory factory = cfg.BuildSessionFactory(); ISession session = factory.OpenSession(); ITransaction transaction = session.BeginTransaction(); User newUser = new User(); newUser.Id = "joe_cool"; newUser.UserName = "Joseph Cool"; newUser.Password = "abc123"; newUser.EmailAddress = "jo...@co..."; newUser.LastLogon = DateTime.Now; // Tell NHibernate that this object should be saved session.Save(newUser); // commit all of the changes to the DB and close the ISession transaction.Commit(); session.Close(); // open another session to retrieve the just inserted user session = factory.OpenSession(); User joeCool = (User)session.Load(typeof(User), "joe_cool"); // set Joe Cool's Last Login property joeCool.LastLogon = DateTime.Now; // flush the changes from the Session to the Database session.Flush(); IList recentUsers = session.CreateCriteria(typeof(User)) .Add(Expression.Expression.Gt("LastLogon", new DateTime(2004, 03, 14, 20, 0, 0))) .List(); foreach(User user in recentUsers) { Assert.IsTrue(user.LastLogon > (new DateTime(2004, 03, 14, 20, 0, 0)) ); } session.Close(); } } } |
From: Michael D. <mik...@us...> - 2004-07-24 20:52:01
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23374/ForumQuestions/T1078029 Added Files: Member.cs Member.hbm.xml MemberFixture.cs Log Message: Adding examples into cvs. --- NEW FILE: Member.hbm.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: MemberFixture.cs --- using System; using System.Collections; using System.Reflection; using NHibernate.Cfg; using NUnit.Framework; namespace NHibernate.Examples.ForumQuestions.T1078029 { /// <summary> /// Summary description for UserFixture. /// </summary> [TestFixture] public class MemberFixture { /// <summary> /// Validate that the Configuration is reading a valid Xml document correctly. /// </summary> [Test] public void ValidateQuickStart() { Configuration cfg = new Configuration(); cfg.AddResource( "NHibernate.Examples.ForumQuestions.T1078029.Member.hbm.xml", Assembly.Load("NHibernate.Examples") ); ISessionFactory factory = cfg.BuildSessionFactory(); } } } --- NEW FILE: Member.cs --- using System; namespace NHibernate.Examples.ForumQuestions.T1078029 { public class Member { private string id; private string name; private DateTime admission; public Member() { } public string Id { get { return id; } set { id = value; } } public string Name { get { return name; } set { name = value; } } public DateTime Admission { get { return admission; } set { admission = value; } } } } |
From: Michael D. <mik...@us...> - 2004-07-24 20:52:01
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions/T1104613 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23374/ForumQuestions/T1104613 Added Files: A.cs A.hbm.xml AOuterJoin.cs OuterJoinFixture.cs Log Message: Adding examples into cvs. --- NEW FILE: A.cs --- using System; using System.Collections; namespace NHibernate.Examples.ForumQuestions.T1104613 { /// <summary> /// Summary description for A. /// </summary> public class A { private string _key; private string _name; private AManyToOne _manyToOne; private IList _outerJoins; public string Key { get { return _key; } set { _key = value; } } public string Name { get { return _name; } set { _name = value; } } public AManyToOne ManyToOne { get { return _manyToOne; } set { _manyToOne = value; } } public IList OuterJoins { get { return _outerJoins; } set { _outerJoins = value; } } } } --- NEW FILE: AOuterJoin.cs --- using System; namespace NHibernate.Examples.ForumQuestions.T1104613 { /// <summary> /// Summary description for AOuterJoin. /// </summary> public class AOuterJoin { private string _key; private string _name; public string Key { get { return _key; } set { _key = value; } } public string Name { get { return _name; } set { _name = value; } } } public class AManyToOne : AOuterJoin { } } --- NEW FILE: A.hbm.xml --- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.Examples.ForumQuestions.T1104613.A, NHibernate.Examples" table="a"> <id name="Key" column="a_id" type="String"> <generator class="uuid.hex" /> </id> <property name="Name" /> <many-to-one name="ManyToOne" not-null="true" outer-join="true" /> <list name="OuterJoins" table="a_oj_list"> <key column="a_id" /> <index column="a_oj_index" /> <many-to-many class="NHibernate.Examples.ForumQuestions.T1104613.AOuterJoin, NHibernate.Examples" outer-join="true" /> </list> </class> <class name="NHibernate.Examples.ForumQuestions.T1104613.AOuterJoin, NHibernate.Examples" table="a_oj"> <id column="a_oj_id" name="Key"> <generator class="uuid.hex" /> </id> <property name="Name" unique="true" not-null="true" length="50" /> </class> <class name="NHibernate.Examples.ForumQuestions.T1104613.AManyToOne, NHibernate.Examples" table="a_mto"> <id column="a_mto_id" name="Key"> <generator class="uuid.hex" /> </id> <property name="Name" unique="true" not-null="true" length="50" /> </class> </hibernate-mapping> --- NEW FILE: OuterJoinFixture.cs --- using System; using System.Collections; using NHibernate; using NUnit.Framework; namespace NHibernate.Examples.ForumQuestions.T1104613 { /// <summary> /// Testing outer-join loading with simple classes. I'm not sure how to /// write a Unit Test to see if this is working or not other than just /// look at the sql profilers output. /// </summary> [TestFixture] public class OuterJoinFixture : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "T1104613.A.hbm.xml"}, true ); } [Test] public void LoadWithOuterJoin() { ISession s = sessions.OpenSession(); const int numOfOjs = 5; A theA = new A(); AManyToOne mto = new AManyToOne(); IList ojList = new ArrayList(numOfOjs); theA.Name = "the A"; mto.Name = "many-to-one"; theA.ManyToOne = mto; for( int i=0; i<numOfOjs; i++) { AOuterJoin aoj = new AOuterJoin(); aoj.Name = "the oj list " + i; ojList.Insert(i, aoj); } theA.OuterJoins = ojList; for( int i=0; i<numOfOjs; i++) { s.Save(ojList[i]); } s.Save(mto); s.Save(theA); s.Flush(); s.Close(); s = sessions.OpenSession(); theA = (A)s.Load( typeof(A), theA.Key ); s.Close(); } } } |
From: Michael D. <mik...@us...> - 2004-07-24 20:52:00
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23374/ForumQuestions Added Files: TestCase.cs Log Message: Adding examples into cvs. --- NEW FILE: TestCase.cs --- using System; using System.Reflection; using NHibernate.Cfg; using NHibernate.Dialect; using NHibernate.Tool.hbm2ddl; namespace NHibernate.Examples.ForumQuestions { /// <summary> /// Summary description for TestCase. /// </summary> public abstract class TestCase { protected Configuration cfg; protected Dialect.Dialect dialect; protected ISessionFactory sessions; public virtual string AssemblyName { get { return "NHibernate.Examples"; } } public void ExportSchema(string[] files) { ExportSchema(files, true); } public void ExportSchema(string[] files, bool exportSchema) { cfg = new Configuration(); for (int i=0; i<files.Length; i++) { cfg.AddResource("NHibernate.Examples.ForumQuestions." + files[i], Assembly.Load(AssemblyName)); } if(exportSchema) new SchemaExport(cfg).Create(true, true); sessions = cfg.BuildSessionFactory( ); dialect = Dialect.Dialect.GetDialect(); } /// <summary> /// Drops the schema that was built with the TestCase's Configuration. /// </summary> public void DropSchema() { new SchemaExport(cfg).Drop(true, true); } } } |
From: Michael D. <mik...@us...> - 2004-07-24 20:52:00
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions/OfferExample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23374/ForumQuestions/OfferExample Added Files: Offer.cs Offer.hbm.xml OfferExample.cs OfferType.cs OfferType.hbm.xml Log Message: Adding examples into cvs. --- NEW FILE: Offer.hbm.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Offer.cs --- using System; namespace NHibernate.Examples.ForumQuestions.OfferExample { /// <summary> /// Summary description for Offer. /// </summary> public class Offer { private int key; private OfferType typeOfOffer; private string madeBy; public Offer() { } public int Key { get { return key; } set { key = value; } } public string MadeBy { get { return madeBy; } set { madeBy = value; } } public OfferType TypeOfOffer { get { return typeOfOffer; } set { typeOfOffer = value; } } } } --- NEW FILE: OfferType.hbm.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: OfferType.cs --- using System; namespace NHibernate.Examples.ForumQuestions.OfferExample { /// <summary> /// Summary description for OfferType. /// </summary> public class OfferType { private int key; private string description; public OfferType() { } public int Key { get { return key; } set { key = value; } } public string Description { get { return description; } set { description = value; } } } } --- NEW FILE: OfferExample.cs --- using System; using System.Collections; using NHibernate; using NHibernate.Cfg; using NHibernate.Examples.ForumQuestions.OfferExample; using NUnit.Framework; namespace NHibernate.Examples.ForumQuestions.OfferExample { /// <summary> /// Summary description for OfferExample. /// </summary> [TestFixture] public class OfferExample : TestCase { [SetUp] public void SetUp() { ExportSchema( new string[] { "OfferExample.OfferType.hbm.xml", "OfferExample.Offer.hbm.xml"}, true ); } [TearDown] public void TearDown() { DropSchema(); } [Test] public void TestExample() { ISession session = sessions.OpenSession(); // load some default values OfferType[] offerType = new OfferType[3]; offerType[0] = new OfferType(); offerType[0].Key = 1; offerType[0].Description = "somevalue"; offerType[1] = new OfferType(); offerType[1].Key = 2; offerType[1].Description = "notthatvalue"; offerType[2] = new OfferType(); offerType[2].Key = 3; offerType[2].Description = "differentvalue"; Offer[] offer = new Offer[8]; for(int i = 0; i < offer.Length; i++) { offer[i] = new Offer(); offer[i].Key = i + 1; offer[i].MadeBy = "Person " + i; offer[i].TypeOfOffer = offerType[0]; if(i < 5) { offer[i].TypeOfOffer = offerType[0]; } else if (i == 5 || i==6) { offer[i].TypeOfOffer = offerType[1]; } else { offer[i].TypeOfOffer = offerType[2]; } } for(int i = 0; i < offerType.Length; i++) { session.Save(offerType[i]); } for(int i = 0; i < offer.Length; i++) { session.Save(offer[i]); } session.Flush(); session.Close(); session = sessions.OpenSession(); string hql = "select offer.MadeBy, offer.TypeOfOffer.Description " + "from NHibernate.Examples.ForumQuestions.OfferExample.Offer as offer " + "where offer.TypeOfOffer.Description = 'somevalue'"; IList offers = session.Find(hql); Assert.AreEqual(5, offers.Count); for(int i=0; i < offers.Count; i++) { object[] currentRow = (object[])offers[i]; Assert.AreEqual("somevalue", currentRow[1]); } session.Close(); } } } |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23374 Added Files: .cvsignore App.config AssemblyInfo.cs NHibernate.Examples-1.1.csproj NHibernate.Examples.build NHibernate.Examples.nunit Log Message: Adding examples into cvs. --- NEW FILE: .cvsignore --- bin obj .#* *.user *.xsx --- NEW FILE: App.config --- <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> </configSections> <nhibernate> <add key="hibernate.show_sql" value="true" /> <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" /> <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" /> <add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" /> <add key="hibernate.connection.connection_string" value="Server=localhost;initial catalog=nhibernate;Integrated Security=SSPI" /> </nhibernate> <!-- This section contains the log4net configuration settings --> <log4net> <!-- Define some output appenders --> <appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net" > <param name="File" value="log.txt" /> <param name="AppendToFile" value="true" /> <param name="RollingStyle" value="Date" /> <param name="DatePattern" value="yyyy.MM.dd" /> <param name="StaticLogFileName" value="true" /> <layout type="log4net.Layout.PatternLayout,log4net"> <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n" /> </layout> </appender> <!-- Setup the root category, add the appenders and set the default priority --> <root> <priority value="ALL" /> <appender-ref ref="rollingFile" /> </root> </log4net> </configuration> --- NEW FILE: NHibernate.Examples.nunit --- <NUnitProject> <Settings activeconfig="Debug" /> <Config name="Debug" appbase="bin\Debug" configfile="NHibernate.Examples.dll.config" binpathtype="Auto"> <assembly path="NHibernate.Examples.dll" /> </Config> <Config name="Release" appbase="bin\Release" configfile="NHibernate.Examples.dll.config" binpathtype="Auto"> <assembly path="NHibernate.Examples.dll" /> </Config> </NUnitProject> --- NEW FILE: AssemblyInfo.cs --- using System.Reflection; using System.Runtime.CompilerServices; [assembly: AssemblyTitleAttribute("NHibernate.Examples")] [assembly: AssemblyDescriptionAttribute("Simple Examples for NHibernate.")] [assembly: AssemblyCompanyAttribute("nhibernate.sf.net")] [assembly: AssemblyProductAttribute("NHibernate")] [assembly: AssemblyCopyright("Licensed under LGPL.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // .NET Framwork Version // Build Number // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersionAttribute("0.0.5000.6")] [assembly: AssemblyInformationalVersionAttribute("0.0")] [assembly: AssemblyFileVersionAttribute("0.0000.6")] [assembly: AssemblyDelaySignAttribute(false)] --- NEW FILE: NHibernate.Examples.build --- <?xml version="1.0" ?> <project name="NHibernate.Examples" 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 --> <target name="build" description="Simple Examples for NHibernate"> <csc target="library" define="${current.build.defines}" debug="${build.debug}" output="${build.dir}/bin/${nant.project.name}.dll" > <references basedir="${build.dir}/bin"> <includes name="System.dll" /> <includes name="System.XML.dll" /> <includes name="System.Data.dll" /> <includes name="NHibernate.dll" /> <includes name="nunit.framework.dll" /> </references> <resources prefix="NHibernate.Examples" dynamicprefix="true"> <includes name="**/*.xml" /> <excludes name="bin/**/*.xml" /> </resources> <sources failonempty="true"> <includes name="**/*.cs" /> </sources> </csc> <copy file="App.config" tofile="${build.dir}/bin/${nant.project.name}.dll.config" /> </target> </project> --- NEW FILE: NHibernate.Examples-1.1.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{E3482030-5828-4112-9906-D4C5153DCE3F}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "NHibernate.Examples" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" PreBuildEvent = 'copy /y "$(ProjectDir)App.config" "$(TargetPath).config"' PostBuildEvent = "" RootNamespace = "NHibernate.Examples" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "false" OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" HintPath = "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> <Reference Name = "NHibernate-1.1" Project = "{EE3B9473-7C64-44FF-B342-91B558D413A8}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> <Reference Name = "nunit.framework" AssemblyName = "nunit.framework" HintPath = "..\..\external-bin\nunit.framework.dll" /> </References> </Build> <Files> <Include> <File RelPath = "App.config" BuildAction = "None" /> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "NHibernate.Examples.build" BuildAction = "None" /> <File RelPath = "NHibernate.Examples.nunit" BuildAction = "None" /> <File RelPath = "Cascades\Alias.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Cascades\Alias.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "Cascades\CascadeFixture.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Cascades\Child.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Cascades\Child.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "Cascades\Parent.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Cascades\Parent.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "ForumQuestions\TestCase.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ForumQuestions\OfferExample\Offer.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ForumQuestions\OfferExample\Offer.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "ForumQuestions\OfferExample\OfferExample.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ForumQuestions\OfferExample\OfferType.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ForumQuestions\OfferExample\OfferType.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "ForumQuestions\T1078029\Member.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ForumQuestions\T1078029\Member.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "ForumQuestions\T1078029\MemberFixture.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ForumQuestions\T1104613\A.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ForumQuestions\T1104613\A.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "ForumQuestions\T1104613\AOuterJoin.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "ForumQuestions\T1104613\OuterJoinFixture.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "QuickStart\User.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "QuickStart\User.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "QuickStart\UserFixture.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> |
From: Michael D. <mik...@us...> - 2004-07-24 20:52:00
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/Cascades In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23374/Cascades Added Files: Alias.cs Alias.hbm.xml CascadeFixture.cs Child.cs Child.hbm.xml Parent.cs Parent.hbm.xml Log Message: Adding examples into cvs. --- NEW FILE: Parent.cs --- using System; using System.Collections; namespace NHibernate.Examples.Cascades { /// <summary> /// Summary description for Parent. /// </summary> public class Parent { int id; string name; IDictionary children; IDictionary aliases; static object emptyObject = new object(); public int Id { get { return id; } set { id = value; } } public string Name { get { return name; } set { name = value; } } private IDictionary ChildrenSet { get { if (children==null) children = new Hashtable(); return children; } set { children = value; } } public ICollection Children { get { return ChildrenSet;} } public void AddChild(Child child) { ChildrenSet[child] = emptyObject; child.SingleParent = this; } public IDictionary Aliases { get { if(aliases==null) aliases = new Hashtable(); return aliases; } set { aliases = value; } } } } --- NEW FILE: CascadeFixture.cs --- using System; using System.Collections; using NHibernate.Cfg; using NHibernate.Tool.hbm2ddl; using NUnit.Framework; namespace NHibernate.Examples.Cascades { /// <summary> /// Summary description for CascadeFixture. /// </summary> [TestFixture] public class CascadeFixture { ISessionFactory factory = null; Configuration cfg = null; [SetUp] public void SetUp() { cfg = new Configuration(); cfg.AddAssembly("NHibernate.Examples"); new SchemaExport(cfg).Create(true, true); factory = cfg.BuildSessionFactory(); } [TearDown] public void TearDown() { //new SchemaExport(cfg).Drop(true, true); } [Test] public void Insert() { ISession session = factory.OpenSession(); Parent dad = new Parent(); dad.Name = "the dad"; Child boy = new Child(); boy.Name = "the boy"; boy.SingleParent = dad; Child girl = new Child(); girl.Name = "the girl"; girl.SingleParent = dad; dad.AddChild(boy); dad.AddChild(girl); session.SaveOrUpdate(dad); dad.Aliases.Add("a1", new Alias("Daddy", "u") ); dad.Aliases.Add("a2", new Alias("Father", "f") ); session.Flush(); session.Close(); int boyId = boy.Id; int girlId = girl.Id; int dadId = dad.Id; session = factory.OpenSession(); dad = (Parent) session.Load( typeof(Parent), dadId ); foreach (Child child in dad.Children) { if (child.Name=="the girl") { Assert.AreEqual(girlId, child.Id); } else { Assert.AreEqual(boyId, child.Id); } } } } } --- NEW FILE: Alias.cs --- using System; namespace NHibernate.Examples.Cascades { /// <summary> /// Summary description for Alias. /// </summary> public class Alias { private int id; private string name; private string type; public Alias() { } public Alias(string name, string type) { this.name = name; this.type = type; } public int Id { get { return id;} set { id = value; } } public string Name { get { return name; } set { name = value; } } public string Type { get { return type; } set { type = value; } } } } --- NEW FILE: Alias.hbm.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Child.hbm.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Child.cs --- using System; using System.Collections; namespace NHibernate.Examples.Cascades { /// <summary> /// Summary description for Child. /// </summary> public class Child { int id; string name; Parent singleParent; public int Id { get { return id; } set { id = value; } } public string Name { get { return name; } set { name = value; } } public Parent SingleParent { get { return singleParent; } set { singleParent = value; } } } } --- NEW FILE: Parent.hbm.xml --- (This appears to be a binary file; contents omitted.) |
From: Michael D. <mik...@us...> - 2004-07-24 20:50:40
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions/T1104613 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23093/T1104613 Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions/T1104613 added to the repository |
From: Michael D. <mik...@us...> - 2004-07-24 20:50:23
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23042/T1078029 Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions/T1078029 added to the repository |
From: Michael D. <mik...@us...> - 2004-07-24 20:50:13
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions/OfferExample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22993/OfferExample Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions/OfferExample added to the repository |
From: Michael D. <mik...@us...> - 2004-07-24 20:47:42
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/QuickStart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22604/QuickStart Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/QuickStart added to the repository |
From: Michael D. <mik...@us...> - 2004-07-24 20:47:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22586/ForumQuestions Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/ForumQuestions added to the repository |
From: Michael D. <mik...@us...> - 2004-07-24 20:47:24
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/Cascades In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22566/Cascades Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/Cascades added to the repository |