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-10-19 05:35:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Eg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25965 Added Files: App.config AssemblyInfo.cs Edge.cs Edge.hbm.xml NetworkDemo.cs NHibernate.Eg-1.1.csproj Source.cs Vertex.cs Vertex.hbm.xml Log Message: removed Eg namespace from NHibernate. Has been added to its own project NHibernate.Eg that will be a part of the Examples solution. --- NEW FILE: Edge.cs --- using System; namespace NHibernate.Eg { public class Edge { private float length; private string name; private float capacity; private Vertex source; private Vertex sink; private long key; private DateTime creationDate = DateTime.Now; public float Capacity { get { return capacity; } set { capacity = value; } } public float Length { get { return length; } set { length = value; } } public string Name { get { return name; } set { name = value; } } public Vertex Source { get { return source; } set { source = value; } } public Vertex Sink { get { return sink; } set { sink = value; } } public long Key { get { return key; } set { key = value; } } public DateTime CreationDate { get { return creationDate; } set { creationDate = value; } } } } --- NEW FILE: Vertex.cs --- using System; using System.Collections; namespace NHibernate.Eg { public class Vertex { private IList incoming = new ArrayList(); private IList outgoing = new ArrayList(); private string name; private long key; private int version; private DateTime creationDate = DateTime.Now; protected IList Incoming { get { return incoming; } set { incoming = value; } } protected IList Outgoing { get { return outgoing; } set { outgoing = value; } } public void AddIncoming(Edge e) { incoming.Add(e); e.Sink = this; } public void AddOutgoing(Edge e) { outgoing.Add(e); e.Source = this; } public void RemoveIncoming(Edge e) { incoming.Remove(e); e.Sink = null; } public void RemoveOutgoing(Edge e) { outgoing.Remove(e); e.Source = null; } public string Name { get { return name; } set { name = value; } } public virtual float ExcessCapacity { get { float excess = 0.0f; foreach( Edge edge in incoming) { excess -= edge.Capacity; } foreach( Edge edge in outgoing) { excess += edge.Capacity; } return excess; } } public long Key { get { return key; } set { key = value; } } public int Version { get { return version; } set { version = value; } } public DateTime CreationDate { get { return creationDate; } set { creationDate = value; } } } } --- NEW FILE: App.config --- <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> </configSections> <nhibernate> <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" /> <!-- The valid strings for Isolation can be found in the documentation for the System.Data.IsolationLevel Enumeration documentation. Use the member names - not the values. --> <!-- --> <add key="hibernate.connection.isolation" value="ReadCommitted" /> <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" /> <!-- This is the System.Data.OracleClient.dll provider for Oracle from MS --> <!-- <add key="hibernate.dialect" value="NHibernate.Dialect.OracleDialect" /> <add key="hibernate.connection.driver_class" value="NHibernate.Driver.OracleClientDriver" /> <add key="hibernate.connection.connection_string" value="Data Source=ora9i;User ID=scott;Password=tiger;" /> --> <!-- This is the ByteFX.Data.dll provider for MySql --> <!-- <add key="hibernate.connection.driver_class" value="NHibernate.Driver.ByteFXDataDriver" /> <add key="hibernate.connection.connection_string" value="Database=test;Data Source=someip;User Id=someuser;Password=somepwd" /> <add key="hibernate.dialect" value="NHibernate.Dialect.MySQLDialect" /> --> <!-- This is the Firebird configuration --> <!-- <add key="hibernate.dialect" value="NHibernate.Dialect.FirebirdDialect" /> <add key="hibernate.connection.driver_class" value="NHibernate.Driver.FirebirdDriver" /> <add key="hibernate.connection.connection_string" value="Data Source=localhost;Database=nhibernate;User=SYSDBA;password=masterkey;Charset=ISO8859_1;ServerType=0" /> --> </nhibernate> <!-- This section contains the log4net configuration settings --> <log4net debug="true"> <!-- 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="DEBUG" /> <appender-ref ref="rollingFile" /> </root> </log4net> </configuration> --- NEW FILE: NHibernate.Eg-1.1.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{4788CEC1-BC6E-420A-B351-4FDF391E4951}" > <Build> <Settings ApplicationIcon = "App.ico" AssemblyKeyContainerName = "" AssemblyName = "NHibernate.Eg" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Exe" PreBuildEvent = "" PostBuildEvent = "" RootNamespace = "NHibernate.Eg" 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 = "HashCodeProvider" AssemblyName = "HashCodeProvider" HintPath = "..\..\lib\HashCodeProvider.dll" /> <Reference Name = "log4net" AssemblyName = "log4net" HintPath = "..\..\lib\net\1.1\log4net.dll" /> <Reference Name = "NHibernate-1.1" Project = "{EE3B9473-7C64-44FF-B342-91B558D413A8}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> </References> </Build> <Files> <Include> <File RelPath = "App.config" BuildAction = "None" /> <File RelPath = "App.ico" BuildAction = "Content" /> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Edge.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Edge.hbm.xml" BuildAction = "EmbeddedResource" /> <File RelPath = "NetworkDemo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Source.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Vertex.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "Vertex.hbm.xml" BuildAction = "EmbeddedResource" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: Vertex.hbm.xml --- <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.Eg.Vertex" table="vertex"> <!--<jcs-cache usage="read-write"/>--> <id column="vertex_id" name="Key"> <generator class="hilo" /> </id> <discriminator column="vertex_type" /> <version column="version_number" name="Version" /> <property name="Name" unique="true" not-null="true" length="50" /> <bag name="Incoming" lazy="true" inverse="true" cascade="all" order-by="name"> <key column="sink" /> <one-to-many class="NHibernate.Eg.Edge" /> </bag> <bag name="Outgoing" lazy="true" inverse="true" cascade="all" order-by="name desc"> <key column="source" /> <one-to-many class="NHibernate.Eg.Edge" /> </bag> <property name="CreationDate" type="DateTime" /> <subclass name="NHibernate.Eg.Source"> <property column="Strength" name="SourceStrength" /> </subclass> </class> </hibernate-mapping> --- 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: Edge.hbm.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Source.cs --- using System; namespace NHibernate.Eg { public class Source : Vertex { private float strength; public float SourceStrength { get { return strength; } set { strength = value; } } public override float ExcessCapacity { get { return base.ExcessCapacity - strength; } } } } --- NEW FILE: NetworkDemo.cs --- using System; using System.IO; using System.Collections; using NHibernate.Cfg; namespace NHibernate.Eg { /// <summary> /// A simple command line application designed to get you started with NHibernate /// </summary> public class NetworkDemo { private static ISessionFactory sessions; private static Configuration ds; [STAThread] public static void Main(string[] args) { // configure the configuration ds = new Configuration() .AddClass(typeof(Vertex)) .AddClass(typeof(Edge)); //build a session factory sessions = ds.BuildSessionFactory(); } public void StartTest() { NetworkDemo.Main(null); } } } |
From: Michael D. <mik...@us...> - 2004-10-19 05:34:07
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Eg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25738/NHibernate.Eg Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Eg added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 05:04:15
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20770 Modified Files: basic_mapping.xml Log Message: worked on it a little bit more. Index: basic_mapping.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/basic_mapping.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** basic_mapping.xml 19 Oct 2004 04:32:01 -0000 1.1 --- basic_mapping.xml 19 Oct 2004 05:04:00 -0000 1.2 *************** *** 138,144 **** --- 138,290 ---- </sect2> + <sect2 id="mapping-declaration-class"> + <title>class</title> + + <para> + You may declare a persistent class using the <literal>class</literal> element: + </para> + + <programlistingco> + + <programlisting><class + name="ClassName" <co id="class1-co" linkends="class1" /> + table="tableName"<co id="class2-co" linkends="class2" /> + discriminator-value="discriminator_value"<co id="class3-co" linkends="class3" /> + mutable="true|false"<co id="class4-co" linkends="class4" /> + schema="owner"<co id="class5-co" linkends="class5" /> + proxy="ProxyInterface"<co id="class6-co" linkends="class6" /> + dynamic-update="true|false"<co id="class7-co" linkends="class7" /> + dynamic-insert="true|false"<co id="class8-co" linkends="class8" /> + polymorphism="implicit|explicit"<co id="class9-co" linkends="class9" /> + where="arbitrary sql where condition"<co id="class10-co" linkends="class10" /> + persister="PersisterClass"<co id="class11-co" linkends="class11" /> + /></programlisting> + <calloutlist> + <callout arearefs="class1-co" id="class1"> + <para> + <literal>name</literal>: The fully qualified .NET Type name of the persistent class + (or interface). + </para> + </callout> + <callout arearefs="class2-co" id="class2"> + <para> + <literal>table</literal>: The name of its database table. + </para> + </callout> + <callout arearefs="class3-co" id="class3"> + <para> + <literal>discriminator-value</literal> (optional - defaults to the class name): A value + that distiguishes individual subclasses, used for polymorphic behaviour. + </para> + </callout> + <callout arearefs="class4-co" id="class4"> + <para> + <literal>mutable</literal> (optional, defaults to <literal>true</literal>): Specifies + that instances of the class are (not) mutable. + </para> + </callout> + <callout arearefs="class5-co" id="class5"> + <para> + <literal>schema</literal> (optional): Override the schema name specified by + the root <literal><hibernate-mapping></literal> element. + </para> + </callout> + <callout arearefs="class6-co" id="class6"> + <para> + <literal>proxy</literal> (optional): Specifies an interface to use for lazy + initializing proxies. You may specify the name of the class itself as long as + all Properties are virtual. + </para> + </callout> + <callout arearefs="class7-co" id="class7"> + <para> + <literal>dynamic-update</literal> (optional, defaults to <literal>false</literal>): + Specifies that <literal>UPDATE</literal> SQL should be generated at runtime and + contain only those columns whose values have changed. + </para> + </callout> + <callout arearefs="class8-co" id="class8"> + <para> + <literal>dynamic-insert</literal> (optional, defaults to <literal>false</literal>): + Specifies that <literal>INSERT</literal> SQL should be generated at runtime and + contain only the columns whose values are not null. + </para> + </callout> + <callout arearefs="class9-co" id="class9"> + + <para> + <literal>polymorphism</literal> (optional, defaults to <literal>implicit</literal>): + Determines whether implicit or explicit query polymorphism is used. + </para> + </callout> + <callout arearefs="class10-co" id="class10"> + <para> + <literal>where</literal> (optional) specify an arbitrary SQL <literal>WHERE</literal> + condition to be used when retrieving objects of this class + </para> + </callout> + <callout arearefs="class11-co" id="class11"> + <para> + <literal>persister</literal> (optional): Specifies a custom <literal>IClassPersister</literal>. + </para> + </callout> + </calloutlist> + </programlistingco> + <para> + It is perfectly acceptable for the named persistent class to be an interface. You would then + declare implementing classes of that interface using the <literal><subclass></literal> + element. You may persist any inner class. You should specify the + class name using the standard form ie. <literal>Eg.Foo+Bar</literal>. + </para> + + <para> + Immutable classes, <literal>mutable="false"</literal>, may not be updated or deleted by the + application. This allows NHibernate to make some minor performance optimizations. + </para> + + <para> + The optional <literal>proxy</literal> attribute enables lazy initialization of persistent + instances of the class. NHibernate will initially return Aspect# proxies which implement + the named interface. The actual persistent object will be loaded when a method of the + proxy is invoked. See "Proxies for Lazy Initialization" below. + </para> + + <para><emphasis>Implicit</emphasis> polymorphism means that instances of the class will be returned + by a query that names any superclass or implemented interface or the class and that instances + of any subclass of the class will be returned by a query that names the class itself. + <emphasis>Explicit</emphasis> polymorphism means that class instances will be returned only + be queries that explicitly name that class and that queries that name the class will return + only instances of subclasses mapped inside this <literal><class></literal> declaration + as a <literal><subclass></literal> or <literal><joined-subclass></literal>. For + most purposes the default, <literal>polymorphism="implicit"</literal>, is appropriate. + Explicit polymorphism is useful when two different classes are mapped to the same table + (this allows a "lightweight" class that contains a subset of the table columns). + </para> + + <para> + The <literal>persister</literal> attribute lets you customize the persistence strategy used for + the class. You may, for example, specify your own subclass of + <literal>NHibernate.Persister.EntityPersister</literal> or you might even provide a + completely new implementation of the interface + <literal>NHibernate.Persister.IClassPersister</literal> that implements persistence via, + for example, stored procedure calls, serialization to flat files or LDAP. See + <literal>NHibernate.DomainModel.CustomPersister</literal> for a simple example (of "persistence" + to a <literal>Hashtable</literal>). + </para> + + <para> + Note that the <literal>dynamic-update</literal> and <literal>dynamic-insert</literal> + settings are not inherited by subclasses and so may also be specified on the + <literal><subclass></literal> or <literal><joined-subclass></literal> elements. + These settings may increase performance in some cases, but might actually decrease + performance in others. Use judiciously. + </para> + + </sect2> + </sect1> + <sect1 id="mapping-quotedidentifiers"> <title>SQL quoted identifiers</title> *************** *** 157,162 **** <property name="itemNumber" column="`Item #`"/> ... ! </class>]]> ! </programlisting> </sect1> --- 303,307 ---- <property name="itemNumber" column="`Item #`"/> ... ! </class>]]></programlisting> </sect1> |
From: Michael D. <mik...@us...> - 2004-10-19 04:42:07
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16160/doc/reference Added Files: DocBook.url DocBook XSL The Complete Guide.url Log Message: A start on the documentation for nhibernate. Added some links that are helpful on how to use docbook. --- NEW FILE: DocBook XSL The Complete Guide.url --- [InternetShortcut] URL=http://www.sagehill.net/docbookxsl/index.html Modified=B02371838EB5C401CF --- NEW FILE: DocBook.url --- [DEFAULT] BASEURL=http://www.oasis-open.org/docbook/documentation/reference/html/docbook.html [InternetShortcut] URL=http://www.oasis-open.org/docbook/documentation/reference/html/docbook.html Modified=805F6C0C95B5C40166 |
From: Michael D. <mik...@us...> - 2004-10-19 04:32:12
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13983/reference/en/modules Added Files: architecture.xml basic_mapping.xml Log Message: A start on the documentation for nhibernate. --- NEW FILE: basic_mapping.xml --- <chapter id="mapping"> <title>Basic O/R Mapping</title> <sect1 id="mapping-declaration"> <title>Mapping declaration</title> <para> Object/relational mappings are defined in an XML document. The mapping document is designed to be readable and hand-editable. The mapping language is .NET-centric, meaning that mappings are constructed around persistent class declarations, not table declarations. </para> <para> Note that, even though many Hibernate users choose to define XML mappings be hand, a number of tools exist to generate the mapping document, including XDoclet, Middlegen and AndroMDA. </para> <para> Lets kick off with an example mapping: </para> <programlisting><![CDATA[ <?xml version="1.0" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="Eg.Cat, Eg" table="CATS" discriminator-value="C"> <id name="Id" column="uid" type="Int64"> <generator class="hilo"/> </id> <discriminator column="subclass" type="Char"/> <property name="Birthdate" type="Date"/> <property name="Color" not-null="true"/> <property name="Sex" not-null="true" update="false"/> <property name="Weight"/> <many-to-one name="Mate" column="mate_id"/> <set name="Kittens"> <key column="mother_id"/> <one-to-many class="Cat"/> </set> <subclass name="DomesticCat" discriminator-value="D"> <property name="Name" type="String"/> </subclass> </class> <class name="Eg.Dog, Eg"> <!-- mapping for Dog could go here --> </class> </hibernate-mapping> ]]></programlisting> <para> We will now discuss the content of the mapping document. We will only describe the document elements and attributes that are used by Hibernate at runtime. The mapping document also contains some extra optional attributes and elements that affect the database schemas exported by the schema export tool. (For example the <literal> not-null</literal> attribute.) </para> <sect2 id="mapping-declaration-doctype"> <title>Schema</title> <para> All XML mappings have to use the nhibernate-mapping-2.0 schema. The actual schema may be found in the NHibernate source directory, or as an Embedded Resource in <literal>NHibernate.dll</literal>. NHibernate will always use the Embedded Resource as the source for the schema. </para> <para> To get intellisense while working with the <literal>hibernate-mapping</literal> xml inside of VisualStudio.NET you should copy the schema to the folder <literal>C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml</literal> </para> </sect2> <sect2 id="mapping-declaration-mapping"> <title>hibernate-mapping</title> <para> This element has four optional attributes. The <literal>schema</literal> attribute specifies that tables referred to by this mapping belong to the named schema. If specified, tablenames will be qualified by the given schema name. If missing, tablenames will be unqualified. The <literal>default-cascade</literal> attribute specifies what cascade style should be assumed for properties and collections which do not specify a <literal>cascade</literal> attribute. The <literal>auto-import</literal> attribute lets us use unqualified class names in the query language, by default. The <literal>default-access</literal> attribute tells us how to access property values. </para> <programlistingco> <programlisting> <hibernate-mapping schema="schemaName" <co id="hm1-co" linkends="hm1" /> default-cascade="none|save-update" <co id="hm2-co" linkends="hm2" /> auto-import="true|false" <co id="hm3-co" linkends="hm3" /> default-access="property|field|nosetter|ClassName" <co id="hm4-co" linkends="hm4" /> > </programlisting> <calloutlist> <callout arearefs="hm1-co" id="hm1"> <para> <literal>schema</literal> (optional): The name of a database schema. </para> </callout> <callout arearefs="hm2-co" id="hm2"> <para> <literal>default-cascade</literal> (optional - defaults to <literal>none</literal>): A default cascade style. </para> </callout> <callout arearefs="hm3-co" id="hm3"> <para> <literal>auto-import</literal> (optional - defaults to <literal>true</literal>): Specifies whether we can use unqualified class names (of classes in this mapping) in the query language. </para> </callout> <callout arearefs="hm4-co" id="hm4"> <para> <literal>default-access</literal> (optional - defaults to <literal>property</literal>): The strategy NHibernate should use for accessing the property value. </para> </callout> </calloutlist> </programlistingco> <para> If you have two persistent classes with the same (unqualified) name, you should set <literal>auto-import="false"</literal>. NHibernate will throw an exception if you attempt to assign two classes to the same "imported" name. </para> </sect2> </sect1> <sect1 id="mapping-quotedidentifiers"> <title>SQL quoted identifiers</title> <para> You may force NHibernate to quote an identifier in the generated SQL by enclosing the table or column name in backticks in the mapping document. NHibernate will use the correct quotation style for the SQL <literal>Dialect</literal> (usually double quotes, but brackets for SQL Server and backticks for MySQL). </para> <programlisting><![CDATA[ <class name="LineItem" table="`Line Item`"> <id name="id" column="`Item Id`"> <generator class="assigned"/> </id> <property name="itemNumber" column="`Item #`"/> ... </class>]]> </programlisting> </sect1> </chapter> --- NEW FILE: architecture.xml --- <chapter id="architecture"> <title>Architecture</title> <sect1 id="architecture-overview"> <title>Overview</title> <para> A (very) high-level view of the NHibernate architecture: </para> <mediaobject> <!-- <imageobject role="fo"> <imagedata fileref="images/overview.svg" format="SVG" align="center"/> </imageobject> --> <imageobject role="html"> <imagedata fileref="../shared/images/overview.gif" format="GIF" align="center"/> </imageobject> </mediaobject> <para> This diagram shows NHibernate using the database and configuration data to provide persistence services (and persistent objects) to the application. </para> <para> We would like to show a more detailed view of the runtime architecture. Unfortunately, NHibernate is flexible and supports several approaches. We will show the two extremes. The "lite" architecture has the application provide its own ADO.NET connections and manage its own transactions. This approach uses a minimal subset of NHibernate's APIs: </para> <mediaobject> <!-- <imageobject role="fo"> <imagedata fileref="images/lite.svg" format="SVG" align="center"/> </imageobject> --> <imageobject role="html"> <imagedata fileref="../shared/images/lite.gif" format="GIF" align="center"/> </imageobject> </mediaobject> <para> The "full cream" architecture abstracts the application away from the underlying ADO.NET API and lets NHibernate take care of the details. </para> <!-- TODO: make images --> <mediaobject> <!-- <imageobject role="fo"> <imagedata fileref="images/full_cream.svg" format="SVG" align="center"/> </imageobject> --> <imageobject role="html"> <imagedata fileref="../shared/images/full_cream.gif" format="GIF" align="center"/> </imageobject> </mediaobject> <para> Heres some definitions of the objects in the diagrams: <variablelist spacing="compact"> <varlistentry> <term>SessionFactory (<literal>NHibernate.ISessionFactory</literal>)</term> <listitem> <para> A threadsafe (immutable) cache of compiled mappings for a single database. A factory for <literal>Session</literal> and a client of <literal>ConnectionProvider</literal>. Might hold an optional (second-level) cache of data that is reusable between transactions, at a process- or cluster-level. </para> </listitem> </varlistentry> <varlistentry> <term>Session (<literal>NHibernate.ISession</literal>)</term> <listitem> <para> A single-threaded, short-lived object representing a conversation between the application and the persistent store. Wraps an ADO.NET connection. Factory for <literal>Transaction</literal>. Holds a mandatory (first-level) cache of persistent objects, used when navigating the object graph or looking up objects by identifier. </para> </listitem> </varlistentry> <varlistentry> <term>Persistent Objects and Collections</term> <listitem> <para> Short-lived, single threaded objects containing persistent state and business function. These might be ordinary objects, the only special thing about them is that they are currently associated with (exactly one) <literal>Session</literal>. As soon as the <literal>Session</literal> is closed, they will be detached and free to use in any application layer (e.g. directly as data transfer objects to and from presentation). </para> </listitem> </varlistentry> <varlistentry> <term>Transient Objects and Collections</term> <listitem> <para> Instances of persistent classes that are not currently associated with a <literal>Session</literal>. They may have been instantiated by the application and not (yet) persisted or they may have been instantiated by a closed <literal>Session</literal>. </para> </listitem> </varlistentry> <varlistentry> <term>Transaction (<literal>NHibernate.ITransaction</literal>)</term> <listitem> <para> (Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. Abstracts application from underlying ADO.NET transaction. A <literal>Session</literal> might span several <literal>Transaction</literal>s in some cases. </para> </listitem> </varlistentry> <varlistentry> <term>ConnectionProvider (<literal>NHibernate.Connection.ConnectionProvider</literal>)</term> <listitem> <para> (Optional) A factory for ADO.NET connections. Abstracts application from underlying <literal>IDbConnection</literal>. Not exposed to application, but can be extended/implemented by the developer. </para> </listitem> </varlistentry> <varlistentry> <term>TransactionFactory (<literal>net.sf.hibernate.TransactionFactory</literal>)</term> <listitem> <para> (Optional) A factory for <literal>Transaction</literal> instances. Not exposed to the application, but can be extended/implemented by the developer. </para> </listitem> </varlistentry> </variablelist> </para> <para> Given a "lite" architecture, the application bypasses the <literal>Transaction</literal>/<literal>TransactionFactory</literal> and/or <literal>ConnectionProvider</literal> APIs to talk to ADO.NET directly. </para> </sect1> </chapter> |
From: Michael D. <mik...@us...> - 2004-10-19 04:32:12
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13983/reference Added Files: Code Project - DocBook Win32 HowTo.url doc.build tools download.url Log Message: A start on the documentation for nhibernate. --- NEW FILE: doc.build --- <?xml version="1.0" ?> <project name="doc" default="build" xmlns="http://nant.sf.net/schemas/nant-0.84.win32.net-1.0.xsd" > <property name="lang" value="en" /> <target name="build" description="Generates html from docbook files."> <!-- I have not figured out a way to modify the Path through NAnt so you need to make sure that xsltproc is in the path --> <mkdir dir="html-single\${lang}" failonerror="false" /> <exec program="xsltproc" commandline="--output html-single\${lang}\reference.html ${lang}\styles\html.xsl ${lang}\master.xml" /> </target> </project> --- NEW FILE: tools download.url --- [InternetShortcut] URL=ftp://ftp.zlatkovic.com/pub/libxml/ Modified=40C0D92D0F32C4010C --- NEW FILE: Code Project - DocBook Win32 HowTo.url --- [InternetShortcut] URL=http://www.codeproject.com/winhelp/docbook_howto.asp Modified=40C0D92D0F32C4010C |
From: Michael D. <mik...@us...> - 2004-10-19 04:32:12
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13983/reference/en Added Files: master.xml Log Message: A start on the documentation for nhibernate. --- NEW FILE: master.xml --- <?xml version="1.0"?> <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../support/docbook-dtd/docbookx.dtd" [ <!ENTITY architecture SYSTEM "modules/architecture.xml"> <!ENTITY basic-mapping SYSTEM "modules/basic_mapping.xml"> ]> <book lang="en"> <bookinfo> <title>NHibernate - Relational Persistence for Idiomatic .NET</title> <subtitle>NHibernate Reference Documentation</subtitle> <releaseinfo>Alpha</releaseinfo> </bookinfo> <toc/> <preface id="preface" revision="1"> <title>Preface</title> <para> Working with object-oriented software and a relational database can be cumbersome and time consuming in today's enterprise environments. NHibernate is an object/relational mapping tool for .NET environments. The term object/relational mapping (ORM) refers to the technique of mapping a data representation from an object model to a relational data model with a SQL-based schema. </para> <para> NHibernate not only takes care of the mapping from .NET classes to database tables (and from .NET data types to SQL data types), but also provides data query and retrieval facilities and can significantly reduce development time otherwise spent with manual data handling in SQL and ADO.NET. </para> <para> NHibernate's goal is to relieve the developer from 95 percent of common data persistence related programming tasks. NHibernate may not be the best solution for data-centric applications that only use stored-procedures to implement the business logic in the database, it is most useful with object-oriented domain models and business logic in the .NET-based middle-tier. However, NHibernate can certainly help you to remove or encapsulate vendor-specific SQL code and will help with the common task of result set translation from a tabular representation to a graph of objects. </para> <para> If you are new to NHibernate and Object/Relational Mapping or even .NET, please follow these steps: </para> <orderedlist> <!--<listitem> <para> Read <xref linkend="quickstart"/>for a 30 minute tutorial, using Tomcat. </para> </listitem>--> <listitem> <para> Read <xref linkend="architecture"/> to understand the environments where NHibernate can be used. </para> </listitem> <listitem> <para> Have a look at the <literal>eg/</literal> directory in the Hibernate distribution, it contains a simple standalone application. Copy your JDBC driver to the <literal>lib/</literal> directory and edit <literal>etc/hibernate.properties</literal>, specifying correct values for your database. From a command prompt in the distribution directory, type <literal>ant eg</literal> (using Ant), or under Windows, type <literal>build eg</literal>. </para> </listitem> <listitem> <para> FAQs are answered on the NHibernate website. </para> </listitem> </orderedlist> <para> If you have questions, use the user forum linked on the NHibernate website. We also provide a JIRA issue trackings system for bug reports and feature requests. If you are interested in the development of NHibernate, join the developer mailing list. If you are interested in translating this documentation into your language, contact us on the developer mailing list. </para> </preface> &architecture; &basic-mapping; <index id="index"/> </book> |
From: Michael D. <mik...@us...> - 2004-10-19 04:32:12
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13983/reference/en/styles Added Files: html.css html.xsl Log Message: A start on the documentation for nhibernate. --- NEW FILE: html.css --- BODY { font: verdana; } A { color: #003399; } A:active { color: #003399; } A:visited { color: #888888; } P, OL, UL, LI, DL, DT, DD, BLOCKQUOTE { color: #000000; } TD, TH, SPAN { color: #000000; } BLOCKQUOTE { margin-right: 0px; } H1, H2, H3, H4, H5, H6 { color: #000000; font-weight:500; margin-top:10px; padding-top:15px; } TABLE { border-collapse: collapse; border-spacing:0; border: 1px thin black; empty-cells: hide; } TD { padding: 4pt; } H1 { font-size: 150%; } H2 { font-size: 140%; } H3 { font-size: 110%; font-weight: bold; } H4 { font-size: 110%; font-weight: bold;} H5 { font-size: 100%; font-style: italic; } H6 { font-size: 100%; font-style: italic; } TT { font-size: 90%; font-family: "Courier New", Courier, monospace; color: #000000; } PRE { font-size: 100%; padding: 5px; border-style: solid; border-width: 1px; border-color: #CCCCCC; background-color: #F4F4F4; } UL, OL, LI { list-style: disc; } HR { width: 100%; height: 1px; background-color: #CCCCCC; border-width: 0px; padding: 0px; color: #CCCCCC; } .variablelist { padding-top: 10; padding-bottom:10; margin:0; } .itemizedlist, UL { padding-top: 0; padding-bottom:0; margin:0; } .term { font-weight:bold; } --- NEW FILE: html.xsl --- <?xml version="1.0"?> <!-- This is the XSL HTML configuration file for the Hibernate Reference Documentation. It took me days to figure out this stuff and fix most of the obvious bugs in the DocBook XSL distribution. Some of the workarounds might not be appropriate with a newer version of DocBook XSL. This file is released as part of Hibernate, hence LGPL licensed. chr...@hi... --> <!DOCTYPE xsl:stylesheet [ <!ENTITY db_xsl_path "../../support/docbook-xsl/"> ]> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns="http://www.w3.org/TR/xhtml1/transitional" exclude-result-prefixes="#default"> <xsl:import href="&db_xsl_path;/html/docbook.xsl"/> <!--################################################### HTML Settings ################################################### --> <xsl:param name="html.stylesheet">../shared/css/html.css</xsl:param> <!-- These extensions are required for table printing and other stuff --> <!-- this requires jars to be available so I'm setting it to 0 instead of 1 --> <xsl:param name="use.extensions">0</xsl:param> <xsl:param name="tablecolumns.extension">0</xsl:param> <xsl:param name="callout.extensions">0</xsl:param> <xsl:param name="graphicsize.extension">0</xsl:param> <!--################################################### Table Of Contents ################################################### --> <!-- Generate the TOCs for named components only --> <xsl:param name="generate.toc"> book toc </xsl:param> <!-- Show only Sections up to level 3 in the TOCs --> <xsl:param name="toc.section.depth">3</xsl:param> <!--################################################### Labels ################################################### --> <!-- Label Chapters and Sections (numbering) --> <xsl:param name="chapter.autolabel">1</xsl:param> <xsl:param name="section.autolabel" select="1"/> <xsl:param name="section.label.includes.component.label" select="1"/> <!--################################################### Callouts ################################################### --> <!-- Don't use graphics, use a simple number style --> <xsl:param name="callout.graphics">0</xsl:param> <!-- Place callout marks at this column in annotated areas --> <xsl:param name="callout.defaultcolumn">90</xsl:param> <!--################################################### Misc ################################################### --> <!-- Placement of titles --> <xsl:param name="formal.title.placement"> figure after example before equation before table before procedure before </xsl:param> </xsl:stylesheet> |
From: Michael D. <mik...@us...> - 2004-10-19 04:29:25
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/support/docbook-xsl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13470/docbook-xsl Log Message: Directory /cvsroot/nhibernate/nhibernate/doc/reference/support/docbook-xsl added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 04:28:37
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/support/docbook-dtd/ent In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13293/ent Log Message: Directory /cvsroot/nhibernate/nhibernate/doc/reference/support/docbook-dtd/ent added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 04:28:28
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/support/docbook-dtd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13257/docbook-dtd Log Message: Directory /cvsroot/nhibernate/nhibernate/doc/reference/support/docbook-dtd added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 04:28:18
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13187/support Log Message: Directory /cvsroot/nhibernate/nhibernate/doc/reference/support added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 04:27:33
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12997/images Log Message: Directory /cvsroot/nhibernate/nhibernate/doc/reference/en/images added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 04:27:14
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/styles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12912/styles Log Message: Directory /cvsroot/nhibernate/nhibernate/doc/reference/en/styles added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 04:27:03
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12844/modules Log Message: Directory /cvsroot/nhibernate/nhibernate/doc/reference/en/modules added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 04:26:27
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12703/en Log Message: Directory /cvsroot/nhibernate/nhibernate/doc/reference/en added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 04:26:17
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12662/reference Log Message: Directory /cvsroot/nhibernate/nhibernate/doc/reference added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 04:26:06
|
Update of /cvsroot/nhibernate/nhibernate/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12553/doc Log Message: Directory /cvsroot/nhibernate/nhibernate/doc added to the repository |
From: Michael D. <mik...@us...> - 2004-10-19 02:24:18
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18017/NHibernate/Type Modified Files: DateTimeType.cs DateType.cs Int16Type.cs Int32Type.cs Int64Type.cs IVersionType.cs TicksType.cs TimeSpanType.cs TimestampType.cs TimeType.cs Log Message: Minor fixups to some of the IVersionTypes. Index: TimestampType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimestampType.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TimestampType.cs 20 Sep 2004 03:00:29 -0000 1.8 --- TimestampType.cs 19 Oct 2004 02:24:08 -0000 1.9 *************** *** 96,99 **** --- 96,101 ---- } + #region IVersionType Members + public object Next(object current) { *************** *** 106,109 **** --- 108,113 ---- } + #endregion + public override string ObjectToSQLString(object value) { Index: DateTimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateTimeType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DateTimeType.cs 20 Sep 2004 03:00:29 -0000 1.10 --- DateTimeType.cs 19 Oct 2004 02:24:08 -0000 1.11 *************** *** 98,101 **** --- 98,103 ---- } + #region IVersionType Members + public object Next(object current) { *************** *** 107,110 **** --- 109,115 ---- get { return DateTime.Now; } } + + #endregion + } } Index: TimeType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeType.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TimeType.cs 20 Sep 2004 03:00:29 -0000 1.6 --- TimeType.cs 19 Oct 2004 02:24:08 -0000 1.7 *************** *** 14,18 **** /// using this Type indicates that you don't care about the Date portion of the DateTime. /// </remarks> ! public class TimeType : ValueTypeType, IIdentifierType, ILiteralType, IVersionType { internal TimeType() : base( new TimeSqlType() ) --- 14,18 ---- /// using this Type indicates that you don't care about the Date portion of the DateTime. /// </remarks> ! public class TimeType : ValueTypeType, IIdentifierType, ILiteralType { internal TimeType() : base( new TimeSqlType() ) *************** *** 86,99 **** return "'" + ((DateTime)value).ToShortTimeString() + "'"; } - - public object Next(object current) - { - return Seed; - } - - public object Seed - { - get { return DateTime.Now; } - } } } --- 86,89 ---- Index: Int16Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int16Type.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Int16Type.cs 20 Sep 2004 03:00:29 -0000 1.4 --- Int16Type.cs 19 Oct 2004 02:24:08 -0000 1.5 *************** *** 39,48 **** } ! public object Next(object current) { return ((short)current) + 1; } ! public object Seed { get { return 0; } } } } --- 39,56 ---- } ! #region IVersionType Members ! ! public object Next(object current) ! { return ((short)current) + 1; } ! ! public object Seed ! { get { return 0; } } + + #endregion + } } Index: DateType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/DateType.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DateType.cs 20 Sep 2004 03:00:29 -0000 1.10 --- DateType.cs 19 Oct 2004 02:24:08 -0000 1.11 *************** *** 3,9 **** using NHibernate.SqlTypes; ! namespace NHibernate.Type { ! public class DateType : ValueTypeType, IIdentifierType, ILiteralType, IVersionType { internal DateType() : base( new DateSqlType() ) --- 3,11 ---- using NHibernate.SqlTypes; ! namespace NHibernate.Type ! { ! public class DateType : ValueTypeType, IIdentifierType, ILiteralType ! { internal DateType() : base( new DateSqlType() ) *************** *** 72,85 **** return "'" + ((DateTime)value).ToShortDateString() + "'"; } - - public object Next(object current) - { - return Seed; - } - - public object Seed - { - get { return DateTime.Now; } - } } } --- 74,77 ---- Index: Int32Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int32Type.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Int32Type.cs 20 Sep 2004 03:00:29 -0000 1.5 --- Int32Type.cs 19 Oct 2004 02:24:08 -0000 1.6 *************** *** 41,45 **** } ! public virtual object Next(object current) { return ((int) current) + 1; } --- 41,48 ---- } ! #region IVersionType Members ! ! public virtual object Next(object current) ! { return ((int) current) + 1; } *************** *** 48,51 **** --- 51,57 ---- get { return 0; } } + + #endregion + } } \ No newline at end of file Index: TimeSpanType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TimeSpanType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TimeSpanType.cs 20 Sep 2004 03:00:29 -0000 1.5 --- TimeSpanType.cs 19 Oct 2004 02:24:08 -0000 1.6 *************** *** 62,65 **** --- 62,67 ---- } + #region IVersionType Members + public object Next(object current) { *************** *** 69,75 **** public object Seed { ! get { return DateTime.Now.Ticks; } } public override string ObjectToSQLString(object value) { --- 71,79 ---- public object Seed { ! get { return new TimeSpan( DateTime.Now.Ticks ); } } + #endregion + public override string ObjectToSQLString(object value) { Index: Int64Type.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/Int64Type.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Int64Type.cs 20 Sep 2004 03:00:29 -0000 1.4 --- Int64Type.cs 19 Oct 2004 02:24:08 -0000 1.5 *************** *** 6,10 **** namespace NHibernate.Type { ! public class Int64Type : ValueTypeType, IIdentifierType, IVersionType { internal Int64Type() : base( new Int64SqlType() ) --- 6,11 ---- namespace NHibernate.Type { ! public class Int64Type : ValueTypeType, IIdentifierType, IVersionType ! { internal Int64Type() : base( new Int64SqlType() ) *************** *** 37,41 **** } ! public object Next(object current) { return ((long)current) + 1; } --- 38,45 ---- } ! #region IVersionType Members ! ! public object Next(object current) ! { return ((long)current) + 1; } *************** *** 45,49 **** } ! public override string ObjectToSQLString(object value) { return value.ToString(); } --- 49,56 ---- } ! #endregion ! ! public override string ObjectToSQLString(object value) ! { return value.ToString(); } Index: IVersionType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/IVersionType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IVersionType.cs 17 Feb 2004 03:29:34 -0000 1.4 --- IVersionType.cs 19 Oct 2004 02:24:08 -0000 1.5 *************** *** 9,12 **** --- 9,18 ---- public interface IVersionType : IType { + /// <summary> + /// When implemented by a class, increments the version. + /// </summary> + /// <param name="current">The current version</param> + /// <returns>an instance of the <see cref="IType"/> that has been incremented.</returns> + object Next(object current); /// <summary> *************** *** 16,25 **** object Seed { get; } ! /// <summary> ! /// When implemented by a class, increments the version. ! /// </summary> ! /// <param name="current">The current version</param> ! /// <returns>an instance of the <see cref="IType"/> that has been incremented.</returns> ! object Next(object current); } ! } \ No newline at end of file --- 22,26 ---- object Seed { get; } ! } ! } Index: TicksType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TicksType.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TicksType.cs 20 Sep 2004 03:00:29 -0000 1.5 --- TicksType.cs 19 Oct 2004 02:24:08 -0000 1.6 *************** *** 67,70 **** --- 67,72 ---- } + #region IVersionType Members + public object Next(object current) { *************** *** 74,80 **** public object Seed { ! get { return DateTime.Now.Ticks; } } public override string ObjectToSQLString(object value) { --- 76,84 ---- public object Seed { ! get { return DateTime.Now; } } + #endregion + public override string ObjectToSQLString(object value) { |
From: Michael D. <mik...@us...> - 2004-10-19 02:24:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18017/NHibernate/Engine Modified Files: Versioning.cs Log Message: Minor fixups to some of the IVersionTypes. Index: Versioning.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Engine/Versioning.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Versioning.cs 28 Mar 2004 06:04:36 -0000 1.3 --- Versioning.cs 19 Oct 2004 02:24:08 -0000 1.4 *************** *** 47,51 **** public static bool SeedVersion(object[] fields, int versionProperty, IVersionType versionType) { ! if ( fields[versionProperty] == null ) { fields[versionProperty] = Seed(versionType); --- 47,51 ---- public static bool SeedVersion(object[] fields, int versionProperty, IVersionType versionType) { ! if ( fields[versionProperty]==null ) { fields[versionProperty] = Seed(versionType); |
From: Michael D. <mik...@us...> - 2004-10-19 02:23:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17801/NHibernate Modified Files: NHibernate-1.1.csproj Log Message: removed Eg namespace from NHibernate. Has been added to its own project NHibernate.Eg that will be a part of the Examples solution. Index: NHibernate-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/NHibernate-1.1.csproj,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** NHibernate-1.1.csproj 13 Oct 2004 04:18:07 -0000 1.51 --- NHibernate-1.1.csproj 19 Oct 2004 02:23:21 -0000 1.52 *************** *** 556,587 **** /> <File - RelPath = "Eg\Edge.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "Eg\Edge.hbm.xml" - BuildAction = "EmbeddedResource" - /> - <File - RelPath = "Eg\NetworkDemo.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "Eg\Source.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "Eg\Vertex.cs" - SubType = "Code" - BuildAction = "Compile" - /> - <File - RelPath = "Eg\Vertex.hbm.xml" - BuildAction = "EmbeddedResource" - /> - <File RelPath = "Engine\Cascades.cs" SubType = "Code" --- 556,559 ---- |
From: Michael D. <mik...@us...> - 2004-10-14 04:33:39
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13630/Type Modified Files: MutableType.cs Log Message: removed some old comments. Index: MutableType.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/MutableType.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MutableType.cs 10 Feb 2004 18:41:42 -0000 1.4 --- MutableType.cs 14 Oct 2004 04:33:15 -0000 1.5 *************** *** 8,40 **** /// Superclass for mutable nullable types. /// </summary> - /// <remarks> - /// <para> - /// This might be the point where we branch out from Hibernate's design and move - /// to a StructType and an ObjectType because these follow along the lines of a - /// Mutable/Immutable Type design. - /// </para> - /// <para> - /// I still need to think about that though... - /// </para> - /// <para> - /// The only types that are Mutable are <see cref="BinaryType"/>, - /// <see cref="DateTimeType"/>, <see cref="SerializableType"/>, and - /// <see cref="TimestampType"/>. I don't know what makes them mutable - /// but I am pretty sure that <see cref="BinaryType"/> and <see cref="SerializableType"/> - /// don't implement a nice equals because they are based on System.Byte[] array. In - /// DOTNET arrays don't implement a nice equals. Arrays don't override - /// Object.Equals(Object) so they inherit Objects implementation - which is reference - /// based. - /// </para> - /// <para> - /// I don't know what about the <see cref="DateTimeType"/> and <see cref="TimestampType"/> - /// makes them mutable in Java. It might have something to do with milliseconds and ticks - /// and how some databases store the values. - /// </para> - /// </remarks> public abstract class MutableType : NullableType { - - /// <summary> /// Initialize a new instance of the MutableType class using a --- 8,13 ---- |
From: Michael D. <mik...@us...> - 2004-10-14 04:33:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13630/Persister Modified Files: NormalizedEntityPersister.cs Log Message: removed some old comments. Index: NormalizedEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/NormalizedEntityPersister.cs,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** NormalizedEntityPersister.cs 21 Sep 2004 09:58:24 -0000 1.32 --- NormalizedEntityPersister.cs 14 Oct 2004 04:33:14 -0000 1.33 *************** *** 195,202 **** //MULTITABLES - // TODO - find out when multitables are used?? I have only come at this through the debug - // for the base class (RootClass). This might become a little bit more clear when I come at this through - // the subclass (Subclass). - // these two will later be converted into arrays for the fields tableNames and tableKeyColumns ArrayList tables = new ArrayList(); --- 195,198 ---- *************** *** 256,261 **** this.subclassTableKeyColumns = (string[][]) keyColumns.ToArray( typeof(string[]) ); - //TODO: figure out exactly how this field is being used. I know that for our Simple example - // the values for the base class are isClassOrSuperclassTable[0] = true; [1] = false; this.isClassOrSuperclassTable = new bool[ this.subclassTableNameClosure.Length ]; for (int j=0; j<subclassTableNameClosure.Length; j++ ) --- 252,255 ---- |
From: Michael D. <mik...@us...> - 2004-10-14 04:33:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13630/Loader Modified Files: Loader.cs Log Message: removed some old comments. Index: Loader.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Loader/Loader.cs,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Loader.cs 14 Sep 2004 17:49:56 -0000 1.35 --- Loader.cs 14 Oct 2004 04:33:14 -0000 1.36 *************** *** 510,514 **** /// <param name="selection"></param> /// <param name="session"></param> - /// TODO: how applicable is this in .NET - DataReaders are forward only I thought... protected void Advance(IDataReader rs, RowSelection selection, ISessionImplementor session) { int firstRow = Loader.GetFirstRow(selection); --- 510,513 ---- |
From: Michael D. <mik...@us...> - 2004-10-14 04:33:31
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13630/Collection Modified Files: Bag.cs SortedMap.cs Log Message: removed some old comments. Index: Bag.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/Bag.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Bag.cs 22 Sep 2004 22:32:49 -0000 1.8 --- Bag.cs 14 Oct 2004 04:33:13 -0000 1.9 *************** *** 343,347 **** { Read(); - //TODO: H2.0.3 has an IteratorProxy - do we need?? return bag.GetEnumerator(); } --- 343,346 ---- Index: SortedMap.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Collection/SortedMap.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SortedMap.cs 9 Aug 2004 03:11:45 -0000 1.4 --- SortedMap.cs 14 Oct 2004 04:33:13 -0000 1.5 *************** *** 109,114 **** - - //TODO: H2.0.3 - there are many more methods - probably because Java has a much // better set of interfaces for Collections than .NET does. --- 109,112 ---- |