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...> - 2005-01-05 22:14:22
|
Update of /cvsroot/nhibernate/nhibernate/src/Iesi.Collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8949/Iesi.Collections Modified Files: AssemblyInfo.cs Log Message: updated from 0.6 build Index: AssemblyInfo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/Iesi.Collections/AssemblyInfo.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AssemblyInfo.cs 8 Dec 2004 15:34:53 -0000 1.4 --- AssemblyInfo.cs 5 Jan 2005 22:14:11 -0000 1.5 *************** *** 6,10 **** // <autogenerated> // This code was generated by a tool. ! // Runtime Version: 1.1.4322.985 // // Changes to this file may cause incorrect behavior and will be lost if --- 6,10 ---- // <autogenerated> // This code was generated by a tool. ! // Runtime Version: 1.1.4322.573 // // Changes to this file may cause incorrect behavior and will be lost if |
From: Michael D. <mik...@us...> - 2005-01-05 21:10:00
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25608/nhibernate Modified Files: NHibernateSolution.build Log Message: preping NHibernate and NHibernateContrib for another build. Index: NHibernateSolution.build =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/NHibernateSolution.build,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** NHibernateSolution.build 30 Dec 2004 16:45:39 -0000 1.23 --- NHibernateSolution.build 5 Jan 2005 21:09:51 -0000 1.24 *************** *** 33,37 **** <property name="project.name" value="nhibernate" /> <property name="project.version.major" value="0" /> ! <property name="project.version.minor" value="5" /> <property name="project.version.build" value="0" /> <property name="project.version.revision" value="0" /> --- 33,37 ---- <property name="project.name" value="nhibernate" /> <property name="project.version.major" value="0" /> ! <property name="project.version.minor" value="6" /> <property name="project.version.build" value="0" /> <property name="project.version.revision" value="0" /> |
From: Michael D. <mik...@us...> - 2005-01-05 21:09:59
|
Update of /cvsroot/nhibernate/NHibernateContrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25608/NHibernateContrib Modified Files: NHibernateContribSolution.build Log Message: preping NHibernate and NHibernateContrib for another build. Index: NHibernateContribSolution.build =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/NHibernateContribSolution.build,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NHibernateContribSolution.build 30 Dec 2004 16:55:37 -0000 1.7 --- NHibernateContribSolution.build 5 Jan 2005 21:09:50 -0000 1.8 *************** *** 33,37 **** <property name="project.name" value="NHibernateContrib" /> <property name="project.version.major" value="0" /> ! <property name="project.version.minor" value="5" /> <property name="project.version.build" value="0" /> <property name="project.version.revision" value="0" /> --- 33,37 ---- <property name="project.name" value="NHibernateContrib" /> <property name="project.version.major" value="0" /> ! <property name="project.version.minor" value="6" /> <property name="project.version.build" value="0" /> <property name="project.version.revision" value="0" /> |
From: Michael D. <mik...@us...> - 2005-01-05 21:09:38
|
Update of /cvsroot/nhibernate/NHibernateContrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25475/NHibernateContrib Modified Files: releasenotes.txt Log Message: preping NHibernateContrib for another build. Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/NHibernateContrib/releasenotes.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** releasenotes.txt 16 Dec 2004 14:31:39 -0000 1.2 --- releasenotes.txt 5 Jan 2005 21:09:20 -0000 1.3 *************** *** 1,2 **** --- 1,7 ---- + Build 0.6.0.0 + ======================== + - Moved NHibernate.Tasks and NHibernate.Tool.hbm2net from the NHibernate package to the NHibernateContrib package. + - Added NHibernate.Tool.Net2Hbm that enables classes to be mapped with Attributes instead of hbm.xml files - contributed by John Morris. + Build 0.5.0.0 ======================== |
From: Michael D. <mik...@us...> - 2005-01-05 21:08:29
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25229/nhibernate/src/NHibernate.Examples Modified Files: NHibernate.Examples-1.1.csproj Log Message: updated references to nunit to point to lib folder Index: NHibernate.Examples-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples/NHibernate.Examples-1.1.csproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NHibernate.Examples-1.1.csproj 18 Nov 2004 02:46:10 -0000 1.7 --- NHibernate.Examples-1.1.csproj 5 Jan 2005 21:08:20 -0000 1.8 *************** *** 89,92 **** --- 89,93 ---- AssemblyName = "nunit.framework" HintPath = "..\..\lib\net\1.1\nunit.framework.dll" + Private = "True" /> <Reference |
From: Michael D. <mik...@us...> - 2005-01-05 21:08:29
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples.VB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25229/nhibernate/src/NHibernate.Examples.VB Modified Files: NHibernate.Examples.VB-1.1.vbproj Log Message: updated references to nunit to point to lib folder Index: NHibernate.Examples.VB-1.1.vbproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Examples.VB/NHibernate.Examples.VB-1.1.vbproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NHibernate.Examples.VB-1.1.vbproj 20 Oct 2004 16:47:20 -0000 1.1 --- NHibernate.Examples.VB-1.1.vbproj 5 Jan 2005 21:08:20 -0000 1.2 *************** *** 71,83 **** /> <Reference - Name = "nunit.framework" - AssemblyName = "nunit.framework" - HintPath = "..\..\external-bin\nunit.framework.dll" - /> - <Reference Name = "NHibernate-1.1" Project = "{EE3B9473-7C64-44FF-B342-91B558D413A8}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> </References> <Imports> --- 71,84 ---- /> <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 = "..\..\lib\net\1.1\nunit.framework.dll" + Private = "True" + /> </References> <Imports> |
From: Michael D. <mik...@us...> - 2005-01-05 03:26:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23717/NHibernate.Test Modified Files: FooBarTest.cs Log Message: Added a test for formula="" mapping. Index: FooBarTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FooBarTest.cs,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** FooBarTest.cs 20 Dec 2004 05:06:30 -0000 1.77 --- FooBarTest.cs 5 Jan 2005 03:26:36 -0000 1.78 *************** *** 3601,3604 **** --- 3601,3622 ---- } + [Test] + public void Formula() + { + Foo foo = new Foo(); + ISession s = sessions.OpenSession(); + object id = s.Save( foo ); + s.Flush(); + s.Close(); + + s = sessions.OpenSession(); + foo = (Foo)s.Find( "from Foo as f where f.id = ?", id, NHibernate.String)[0]; + Assert.AreEqual( 4, foo.Formula, "should be 2x 'Int' property that is defaulted to 2" ); + + s.Delete( foo ); + s.Flush(); + s.Close(); + } + } } |
From: Michael D. <mik...@us...> - 2005-01-05 03:26:46
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23717/NHibernate.DomainModel Modified Files: Foo.cs FooBar.hbm.xml Log Message: Added a test for formula="" mapping. Index: FooBar.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/FooBar.hbm.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** FooBar.hbm.xml 16 Dec 2004 21:57:39 -0000 1.20 --- FooBar.hbm.xml 5 Jan 2005 03:26:35 -0000 1.21 *************** *** 69,73 **** <property name="Locale" column="`localeayzabc123!@#$`" access="field.camelcase-underscore" type="locale"/> ! <property name="Formula" formula="1/2 * int_"/> <property name="Custom" type="NHibernate.DomainModel.DoubleStringType, NHibernate.DomainModel" access="field.camelcase"> --- 69,77 ---- <property name="Locale" column="`localeayzabc123!@#$`" access="field.camelcase-underscore" type="locale"/> ! <!-- ! h2.0.3 had this a 1/2 * int_ - but with Mssql that was returning 0 (which could be mistaken ! for an uninitialized Int32 ! --> ! <property name="Formula" formula="2 * int_"/> <property name="Custom" type="NHibernate.DomainModel.DoubleStringType, NHibernate.DomainModel" access="field.camelcase"> Index: Foo.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.DomainModel/Foo.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Foo.cs 20 Dec 2004 05:06:29 -0000 1.15 --- Foo.cs 5 Jan 2005 03:26:35 -0000 1.16 *************** *** 49,53 **** private byte[] _bytes; private System.Globalization.CultureInfo _locale; ! private String _formula; private string[] custom; private int _version; --- 49,54 ---- private byte[] _bytes; private System.Globalization.CultureInfo _locale; ! // in h2.0.3 this was a float ! private int _formula; private string[] custom; private int _version; *************** *** 257,261 **** /// Get/set for formula /// </summary> ! public String Formula { get { return _formula; } --- 258,262 ---- /// Get/set for formula /// </summary> ! public int Formula { get { return _formula; } |
From: Michael D. <mik...@us...> - 2005-01-05 02:47:17
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16290/NHibernate/Impl Modified Files: QueryImpl.cs Log Message: Fixed problem with assigning a DynamicProxy entity to a parameter. Index: QueryImpl.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Impl/QueryImpl.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** QueryImpl.cs 31 Dec 2004 19:52:25 -0000 1.18 --- QueryImpl.cs 5 Jan 2005 02:47:05 -0000 1.19 *************** *** 570,574 **** public IQuery SetParameter( string name, object val ) { ! SetParameter( name, val, GuessType( val.GetType() ) ); return this; } --- 570,574 ---- public IQuery SetParameter( string name, object val ) { ! SetParameter( name, val, GuessType( val ) ); return this; } *************** *** 582,586 **** public IQuery SetParameter( int position, object val ) { ! SetParameter( position, val, GuessType( val.GetType() ) ); return this; } --- 582,586 ---- public IQuery SetParameter( int position, object val ) { ! SetParameter( position, val, GuessType( val ) ); return this; } |
From: Michael D. <mik...@us...> - 2005-01-05 02:44:56
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15832/NHibernate.Test/JoinedSubclass Modified Files: Address.cs Customer.cs Employee.cs JoinedSubclass.Customer.hbm.xml JoinedSubclass.Employee.hbm.xml JoinedSubclass.hbm.xml JoinedSubclass.Person.hbm.xml JoinedSubclassFixture.cs Person.cs Log Message: Modified JoinedSubclass tests to work with Proxies. Added another test to make sure NHibernateProxyHelper is working. Index: Employee.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/Employee.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Employee.cs 10 Dec 2004 16:40:03 -0000 1.1 --- Employee.cs 5 Jan 2005 02:44:18 -0000 1.2 *************** *** 15,19 **** public Employee() {} ! public string Title { get { return _title; } --- 15,19 ---- public Employee() {} ! public virtual string Title { get { return _title; } *************** *** 21,25 **** } ! public Decimal Salary { get { return _salary; } --- 21,25 ---- } ! public virtual Decimal Salary { get { return _salary; } *************** *** 27,31 **** } ! public Employee Manager { get { return _manager; } --- 27,31 ---- } ! public virtual Employee Manager { get { return _manager; } Index: JoinedSubclass.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/JoinedSubclass.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JoinedSubclass.hbm.xml 10 Dec 2004 16:40:03 -0000 1.1 --- JoinedSubclass.hbm.xml 5 Jan 2005 02:44:18 -0000 1.2 *************** *** 15,18 **** --- 15,19 ---- name="NHibernate.Test.JoinedSubclass.Person, NHibernate.Test" table="person" + proxy="NHibernate.Test.JoinedSubclass.Person, NHibernate.Test" > <id *************** *** 38,41 **** --- 39,43 ---- name="NHibernate.Test.JoinedSubclass.Employee, NHibernate.Test" table="empl" + proxy="NHibernate.Test.JoinedSubclass.Employee, NHibernate.Test" > <key column="person_id"/> *************** *** 48,51 **** --- 50,54 ---- name="NHibernate.Test.JoinedSubclass.Customer, NHibernate.Test" table="cust" + proxy="NHibernate.Test.JoinedSubclass.Customer, NHibernate.Test" > <key column="person_id"/> Index: JoinedSubclassFixture.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/JoinedSubclassFixture.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JoinedSubclassFixture.cs 10 Dec 2004 16:40:03 -0000 1.1 --- JoinedSubclassFixture.cs 5 Jan 2005 02:44:18 -0000 1.2 *************** *** 2,5 **** --- 2,7 ---- using System.Collections; + using NHibernate.Proxy; + using NUnit.Framework; *************** *** 79,83 **** { //TODO: proxies make this work ! // Assert.IsFalse( NHibernate.IsInitialized( c.Salesperson ) ); Assert.AreEqual( "Mark", c.Salesperson.Name ); } --- 81,85 ---- { //TODO: proxies make this work ! Assert.IsFalse( NHibernate.IsInitialized( c.Salesperson ) ); Assert.AreEqual( "Mark", c.Salesperson.Name ); } *************** *** 102,105 **** --- 104,155 ---- } + [Test] + public void TestHql() + { + // test the Save + ISession s = sessions.OpenSession(); + ITransaction t = s.BeginTransaction(); + + Employee wally = new Employee(); + wally.Name = "wally"; + wally.Title = "Unmanaged Employee"; + + Employee dilbert = new Employee(); + dilbert.Name = "dilbert"; + dilbert.Title = "office clown"; + + Employee pointyhair = new Employee(); + pointyhair.Name = "pointyhair"; + pointyhair.Title = "clown watcher"; + + dilbert.Manager = pointyhair; + + s.Save( wally ); + s.Save( dilbert ); + s.Save( pointyhair ); + t.Commit(); + s.Close(); + + // get a proxied - initialized version of manager + s = sessions.OpenSession(); + pointyhair = (Employee) s.Load( typeof(Employee), pointyhair.Id ); + NHibernate.Initialize( pointyhair ); + s.Close(); + + s = sessions.OpenSession(); + IQuery q = s.CreateQuery( "from Employee as e where e.Manager = :theMgr" ); + q.SetParameter( "theMgr", pointyhair ); + IList results = q.List(); + Assert.AreEqual( 1, results.Count, "should only return 1 employee."); + dilbert = (Employee)results[0]; + Assert.AreEqual( "dilbert", dilbert.Name, "should have been dilbert returned."); + + s.Delete( wally ); + s.Delete( pointyhair ); + s.Delete( dilbert ); + s.Flush(); + s.Close(); + } + /// <summary> /// Test the ability to insert a new row with a User Assigned Key *************** *** 135,145 **** // perform a load based on the base class ! Person empAsPerson = (Person)s.Load( typeof(Person), empId ); person = (Person)s.Load( typeof(Person), personId ); ! // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass ! emp = empAsPerson as Employee; ! Assert.IsNotNull(emp); // lets update the objects --- 185,195 ---- // perform a load based on the base class ! Person empAsPerson = (Person)s.Find( "from Person as p where p.id = ?", empId, NHibernate.Int32 )[0]; person = (Person)s.Load( typeof(Person), personId ); ! // the object with id=2 was loaded using the base class - lets make sure it actually loaded // the sublcass ! Assert.AreEqual( typeof(Employee), empAsPerson.GetType(), "even though person was queried, should have returned correct subclass."); ! emp = (Employee)s.Load( typeof(Employee), empId ); // lets update the objects *************** *** 151,154 **** --- 201,207 ---- emp.Title = "office dunce"; + // verify the it actually changes the same object + Assert.AreEqual( emp.Name, empAsPerson.Name, "emp and empAsPerson should refer to same object." ); + // save it through the base class reference and make sure that the // subclass properties get updated. Index: Customer.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/Customer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Customer.cs 10 Dec 2004 16:40:03 -0000 1.1 --- Customer.cs 5 Jan 2005 02:44:18 -0000 1.2 *************** *** 15,19 **** } ! public Employee Salesperson { get { return _salesperson; } --- 15,19 ---- } ! public virtual Employee Salesperson { get { return _salesperson; } *************** *** 21,25 **** } ! public string Comments { get { return _comments; } --- 21,25 ---- } ! public virtual string Comments { get { return _comments; } Index: JoinedSubclass.Employee.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/JoinedSubclass.Employee.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JoinedSubclass.Employee.hbm.xml 10 Dec 2004 16:40:03 -0000 1.1 --- JoinedSubclass.Employee.hbm.xml 5 Jan 2005 02:44:18 -0000 1.2 *************** *** 13,16 **** --- 13,17 ---- name="NHibernate.Test.JoinedSubclass.Employee, NHibernate.Test" table="j_sc_one" + proxy="NHibernate.Test.JoinedSubclass.Employee, NHibernate.Test" > <key column="person_id"/> Index: JoinedSubclass.Customer.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/JoinedSubclass.Customer.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JoinedSubclass.Customer.hbm.xml 10 Dec 2004 16:40:03 -0000 1.1 --- JoinedSubclass.Customer.hbm.xml 5 Jan 2005 02:44:18 -0000 1.2 *************** *** 1,3 **** ! <?xml version="1.0" encoding="utf-8" ?> --- 1,3 ---- ! <?xml version="1.0" encoding="utf-8" ?> *************** *** 16,19 **** --- 16,20 ---- name="NHibernate.Test.JoinedSubclass.Customer, NHibernate.Test" table="cust" + proxy="NHibernate.Test.JoinedSubclass.Customer, NHibernate.Test" > <key column="person_id"/> Index: JoinedSubclass.Person.hbm.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/JoinedSubclass.Person.hbm.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JoinedSubclass.Person.hbm.xml 10 Dec 2004 16:40:03 -0000 1.1 --- JoinedSubclass.Person.hbm.xml 5 Jan 2005 02:44:18 -0000 1.2 *************** *** 9,12 **** --- 9,13 ---- name="NHibernate.Test.JoinedSubclass.Person, NHibernate.Test" table="j_sc" + proxy="NHibernate.Test.JoinedSubclass.Person, NHibernate.Test" > <id Index: Person.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/Person.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Person.cs 10 Dec 2004 16:40:03 -0000 1.1 --- Person.cs 5 Jan 2005 02:44:18 -0000 1.2 *************** *** 17,26 **** } ! public int Id { get { return _id; } } ! public string Name { get { return _name; } --- 17,26 ---- } ! public virtual int Id { get { return _id; } } ! public virtual string Name { get { return _name; } *************** *** 28,32 **** } ! public char Sex { get { return _sex; } --- 28,32 ---- } ! public virtual char Sex { get { return _sex; } *************** *** 34,38 **** } ! public Address Address { get { return _address; } --- 34,38 ---- } ! public virtual Address Address { get { return _address; } Index: Address.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/JoinedSubclass/Address.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Address.cs 10 Dec 2004 16:40:02 -0000 1.1 --- Address.cs 5 Jan 2005 02:44:18 -0000 1.2 *************** *** 16,20 **** } ! public string Street { get { return _street; } --- 16,20 ---- } ! public virtual string Street { get { return _street; } *************** *** 22,26 **** } ! public string Zip { get { return _zip; } --- 22,26 ---- } ! public virtual string Zip { get { return _zip; } *************** *** 28,32 **** } ! public string Country { get { return _country; } --- 28,32 ---- } ! public virtual string Country { get { return _country; } |
From: Michael D. <mik...@us...> - 2005-01-05 02:44:33
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15832/NHibernate.Test/ProxyTest Added Files: AProxy.cs AProxy.hbm.xml NHibernateProxyHelperFixture.cs Log Message: Modified JoinedSubclass tests to work with Proxies. Added another test to make sure NHibernateProxyHelper is working. --- NEW FILE: AProxy.hbm.xml --- <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="NHibernate.Test.ProxyTest.AProxy, NHibernate.Test" table="aproxy" proxy="NHibernate.Test.ProxyTest.AProxy, NHibernate.Test" > <id name="Id" unsaved-value="0"> <generator class="native" /> </id> <property name="Name" /> </class> </hibernate-mapping> --- NEW FILE: AProxy.cs --- using System; namespace NHibernate.Test.ProxyTest { /// <summary> /// Summary description for AProxy. /// </summary> public class AProxy { int _id; string _name; public AProxy() { } public virtual int Id { get { return _id; } set { _id = value; } } public virtual string Name { get { return _name; } set { _name = value; } } } } --- NEW FILE: NHibernateProxyHelperFixture.cs --- using System; using NHibernate.Proxy; using NUnit.Framework; namespace NHibernate.Test.ProxyTest { /// <summary> /// Summary description for NHibernateProxyHelperFixture. /// </summary> [TestFixture] public class NHibernateProxyHelperFixture : TestCase { #region NUnit.Framework.TestFixture Members [TestFixtureSetUp] public void TestFixtureSetUp() { ExportSchema( new string[] { "ProxyTest.AProxy.hbm.xml"}, true, "NHibernate.Test" ); } [SetUp] public void SetUp() { // there are test in here where we don't need to resetup the // tables - so only set the tables up once } [TearDown] public override void TearDown() { // do nothing except not let the base TearDown get called } [TestFixtureTearDown] public void TestFixtureTearDown() { base.TearDown(); } #endregion [Test] public void GetClassOfProxy() { ISession s = null; AProxy a = new AProxy(); try { s = sessions.OpenSession(); a.Name = "a proxy"; s.Save( a ); s.Flush(); } finally { if( s!=null ) { s.Close(); } } try { s = sessions.OpenSession(); System.Type type = NHibernateProxyHelper.GetClass( a ); Assert.AreEqual( typeof(AProxy), type, "Should have returned 'A' for a non-proxy" ); AProxy aProxied = (AProxy)s.Load( typeof(AProxy), a.Id ); Assert.IsFalse( NHibernate.IsInitialized( aProxied ), "should be a proxy" ); type = NHibernateProxyHelper.GetClass( aProxied ); Assert.AreEqual( typeof(AProxy), type, "even though aProxied was a Proxy it should have returned the correct type." ); s.Delete( aProxied ); s.Flush(); } finally { if( s!=null ) { s.Close(); } } } } } |
From: Michael D. <mik...@us...> - 2005-01-05 02:44:30
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15832/NHibernate.Test Modified Files: NHibernate.Test-1.1.csproj Log Message: Modified JoinedSubclass tests to work with Proxies. Added another test to make sure NHibernateProxyHelper is working. Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** NHibernate.Test-1.1.csproj 3 Jan 2005 03:43:53 -0000 1.59 --- NHibernate.Test-1.1.csproj 5 Jan 2005 02:44:17 -0000 1.60 *************** *** 547,550 **** --- 547,564 ---- /> <File + RelPath = "ProxyTest\AProxy.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "ProxyTest\AProxy.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "ProxyTest\NHibernateProxyHelperFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "SqlCommandTest\SqlDeleteBuilderFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2005-01-05 01:15:05
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyTest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1711/ProxyTest Log Message: Directory /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ProxyTest added to the repository |
From: Michael D. <mik...@us...> - 2005-01-03 03:49:01
|
Update of /cvsroot/nhibernate/nhibernate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16959 Modified Files: releasenotes.txt Log Message: updated release notes about error checking improvements. Index: releasenotes.txt =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/releasenotes.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** releasenotes.txt 30 Dec 2004 16:45:39 -0000 1.23 --- releasenotes.txt 3 Jan 2005 03:48:42 -0000 1.24 *************** *** 1,17 **** Build 0.6.0.0 ======================== ! - Added support for proxy="" on classes. - Added a configuration parameter "hibernate.prepare_sql" to turn on or off calls to IDbCommand.Prepare(). - Added NHibernate Type for System.SByte. (Sergey Koshcheyev) - Added support for mapping subclasses and joined-subclasses in different files through addition of extends attribute. (Andrew Mayorov) - Added support for LIMIT to MySQLDialect. (Sergey Koshcheyev) ! - Removed DbType {get;} from IUserType. - Fixed problem with spaces in sql generated from hql and MySql. - - Modified logging in Transaction to not generate as many messages. - - Modified how exceptions are rethrown so call stack of original exception is not lost. - Fixed bug with Configuration when there is a class without a namespace. - Fixed bug with Sql generated for an IN clause that contains a class/subclass with a discriminator-value="null". - - Improved error messages when IDbCommand and IDbConnection can't be found by the IDriver. - Fixed potential threading problem with QueryTranslator. Build 0.5.0.0 --- 1,19 ---- Build 0.6.0.0 ======================== ! - Added support for proxy="" on classes. proxy="" must either specify an Interface or the properties that need to be proxied have to be virtual. - Added a configuration parameter "hibernate.prepare_sql" to turn on or off calls to IDbCommand.Prepare(). - Added NHibernate Type for System.SByte. (Sergey Koshcheyev) - Added support for mapping subclasses and joined-subclasses in different files through addition of extends attribute. (Andrew Mayorov) - Added support for LIMIT to MySQLDialect. (Sergey Koshcheyev) ! - Improved error messages when IDbCommand and IDbConnection can't be found by the IDriver. ! - Improved error message when mapped class is missing a constructor with no args. - Fixed problem with spaces in sql generated from hql and MySql. - Fixed bug with Configuration when there is a class without a namespace. - Fixed bug with Sql generated for an IN clause that contains a class/subclass with a discriminator-value="null". - Fixed potential threading problem with QueryTranslator. + - Modified logging in Transaction to not generate as many messages. + - Modified how exceptions are rethrown so call stack of original exception is not lost. + - Moved NHibernate.Tasks and NHibernate.Tool.hbm2net to the NHibernateContrib package. + - Removed DbType {get;} from IUserType. Build 0.5.0.0 |
From: Michael D. <mik...@us...> - 2005-01-03 03:46:59
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16646/NHibernate/Mapping Modified Files: PersistentClass.cs RootClass.cs Subclass.cs Log Message: Added more xml comments. Removed the set property for Polymorphicto be part of the IsPolymorphic property. Index: PersistentClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/PersistentClass.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PersistentClass.cs 2 Jan 2005 22:03:39 -0000 1.16 --- PersistentClass.cs 3 Jan 2005 03:46:48 -0000 1.17 *************** *** 203,214 **** /// <summary> /// When implemented by a class, gets or set a boolean indicating ! /// if the PersistentClass has properties that can be changed. /// </summary> /// <value><c>true</c> if the object is mutable.</value> public abstract bool IsMutable { get; set; } /// <summary> /// When implemented by a class, gets a boolean indicating ! /// if the PersistentClass has a Property for the <c>id</c>. /// </summary> /// <value><c>true</c> if there is a Property for the <c>id</c>.</value> --- 203,217 ---- /// <summary> /// When implemented by a class, gets or set a boolean indicating ! /// if the mapped class has properties that can be changed. /// </summary> /// <value><c>true</c> if the object is mutable.</value> + /// <remarks> + /// The value of this is set by the <c>mutable</c> attribute. + /// </remarks> public abstract bool IsMutable { get; set; } /// <summary> /// When implemented by a class, gets a boolean indicating ! /// if the mapped class has a Property for the <c>id</c>. /// </summary> /// <value><c>true</c> if there is a Property for the <c>id</c>.</value> *************** *** 216,220 **** /// <summary> ! /// When implemented by a class, gets the <see cref="Property"/> /// that is used as the <c>id</c>. /// </summary> --- 219,223 ---- /// <summary> ! /// When implemented by a class, gets or sets the <see cref="Property"/> /// that is used as the <c>id</c>. /// </summary> *************** *** 245,277 **** public abstract Value Discriminator { get; set; } ! /// <summary></summary> public abstract bool IsInherited { get; } ! // see the comment in RootClass about why the polymorphic setter is commented out ! /// <summary></summary> ! public abstract bool IsPolymorphic { get; } ! /// <summary></summary> public abstract bool IsVersioned { get; } ! /// <summary></summary> public abstract ICacheConcurrencyStrategy Cache { get; set; } ! /// <summary></summary> public abstract PersistentClass Superclass { get; set; } ! /// <summary></summary> public abstract bool IsExplicitPolymorphism { get; set; } ! /// <summary></summary> public abstract ICollection PropertyClosureCollection { get; } ! /// <summary></summary> public abstract ICollection TableClosureCollection { get; } /// <summary> ! /// /// </summary> ! /// <param name="p"></param> public virtual void AddSubclassProperty( Property p ) { --- 248,338 ---- public abstract Value Discriminator { get; set; } ! /// <summary> ! /// When implemented by a class, gets a boolean indicating if this ! /// mapped class is inherited from another. ! /// </summary> ! /// <value> ! /// <c>true</c> if this class is a <c>subclass</c> or <c>joined-subclass</c> ! /// that inherited from another <c>class</c>. ! /// </value> public abstract bool IsInherited { get; } ! /// <summary> ! /// When implemented by a class, gets or sets if the mapped class has subclasses or is ! /// a subclass. ! /// </summary> ! /// <value> ! /// <c>true</c> if the mapped class has subclasses or is a subclass. ! /// </value> ! public abstract bool IsPolymorphic { get; set; } ! /// <summary> ! /// When implemented by a class, gets a boolean indicating if the mapped class ! /// has a version property. ! /// </summary> ! /// <value><c>true</c> if there is a <c><version></c> property.</value> public abstract bool IsVersioned { get; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="ICacheConcurrencyStrategy"/> ! /// to use to read/write instances of the persistent class to the Cache. ! /// </summary> ! /// <value>The <see cref="ICacheConcurrencyStrategy"/> used with the Cache.</value> public abstract ICacheConcurrencyStrategy Cache { get; set; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="PersistentClass"/> ! /// that this mapped class is extending. ! /// </summary> ! /// <value> ! /// The <see cref="PersistentClass"/> that this mapped class is extending. ! /// </value> public abstract PersistentClass Superclass { get; set; } ! /// <summary> ! /// When implemented by a class, gets or sets a boolean indicating if ! /// explicit polymorphism should be used in Queries. ! /// </summary> ! /// <value> ! /// <c>true</c> if only classes queried on should be returned, <c>false</c> ! /// if any class in the heirarchy should implicitly be returned.</value> ! /// <remarks> ! /// The value of this is set by the <c>polymorphism</c> attribute. ! /// </remarks> public abstract bool IsExplicitPolymorphism { get; set; } ! /// <summary> ! /// When implemented by a class, gets an <see cref="ICollection"/> ! /// of <see cref="Property"/> objects that this mapped class contains. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains. ! /// </value> ! /// <remarks> ! /// This is all of the properties of this mapped class and each mapped class that ! /// it is inheriting from. ! /// </remarks> public abstract ICollection PropertyClosureCollection { get; } ! /// <summary> ! /// When implemented by a class, gets an <see cref="ICollection"/> ! /// of <see cref="Table"/> objects that this mapped class reads from ! /// and writes to. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Table"/> objects that ! /// this mapped class reads from and writes to. ! /// </value> ! /// <remarks> ! /// This is all of the tables of this mapped class and each mapped class that ! /// it is inheriting from. ! /// </remarks> public abstract ICollection TableClosureCollection { get; } /// <summary> ! /// Adds a <see cref="Property"/> that is implemented by a subclass. /// </summary> ! /// <param name="p">The <see cref="Property"/> implemented by a subclass.</param> public virtual void AddSubclassProperty( Property p ) { *************** *** 280,286 **** /// <summary> ! /// /// </summary> ! /// <param name="table"></param> public virtual void AddSubclassTable( Table table ) { --- 341,347 ---- /// <summary> ! /// Adds a <see cref="Table"/> that a subclass is stored in. /// </summary> ! /// <param name="table">The <see cref="Table"/> the subclass is stored in.</param> public virtual void AddSubclassTable( Table table ) { *************** *** 288,292 **** } ! /// <summary></summary> public virtual ICollection SubclassPropertyClosureCollection { --- 349,360 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains and that all of its subclasses contain. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains and that all of its subclasses contain. ! /// </value> public virtual ICollection SubclassPropertyClosureCollection { *************** *** 301,307 **** /// <summary> ! /// Returns an ICollection of all of the Tables that the subclass finds its information ! /// in. /// </summary> /// <remarks>It adds the TableClosureCollection and the subclassTables into the ICollection.</remarks> public virtual ICollection SubclassTableClosureCollection --- 369,376 ---- /// <summary> ! /// Gets an <see cref="ICollection"/> of all of the <see cref="Table"/> objects that the ! /// subclass finds its information in. /// </summary> + /// <value>An <see cref="ICollection"/> of <see cref="Table"/> objects.</value> /// <remarks>It adds the TableClosureCollection and the subclassTables into the ICollection.</remarks> public virtual ICollection SubclassTableClosureCollection *************** *** 316,320 **** } ! /// <summary></summary> public virtual System.Type ProxyInterface { --- 385,395 ---- } ! /// <summary> ! /// Gets or sets the <see cref="System.Type"/> to use as a Proxy. ! /// </summary> ! /// <value>The <see cref="System.Type"/> to use as a Proxy.</value> ! /// <remarks> ! /// The value of this is set by the <c>proxy</c> attribute. ! /// </remarks> public virtual System.Type ProxyInterface { *************** *** 323,327 **** } ! /// <summary></summary> public virtual bool IsForceDiscriminator { --- 398,409 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if only values in the discriminator column that ! /// are mapped will be included in the sql. ! /// </summary> ! /// <value><c>true</c> if the mapped discriminator values should be forced.</value> ! /// <remarks> ! /// The value of this is set by the <c>force</c> attribute on the <c>discriminator</c> element. ! /// </remarks> public virtual bool IsForceDiscriminator { *************** *** 330,352 **** } ! /// <summary></summary> public abstract bool HasEmbeddedIdentifier { get; set; } ! /// <summary></summary> public abstract System.Type Persister { get; set; } ! /// <summary></summary> public abstract Table RootTable { get; } ! /// <summary></summary> public abstract RootClass RootClazz { get; } ! /// <summary></summary> public abstract Value Key { get; set; } /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> public virtual void CreatePrimaryKey( Dialect.Dialect dialect ) { --- 412,465 ---- } ! /// <summary> ! /// When implemented by a class, gets or sets a boolean indicating if the identifier is ! /// embedded in the class. ! /// </summary> ! /// <value><c>true</c> if the class identifies itself.</value> ! /// <remarks> ! /// An embedded identifier is true when using a <c>composite-id</c> specifying ! /// properties of the class as the <c>key-property</c> instead of using a class ! /// as the <c>composite-id</c>. ! /// </remarks> public abstract bool HasEmbeddedIdentifier { get; set; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="System.Type"/> of ! /// the Persister. ! /// </summary> ! /// <value>The <see cref="System.Type"/> of the Persister.</value> ! /// <remarks>The value of this is set by the <c>persister</c> attribute.</remarks> public abstract System.Type Persister { get; set; } ! /// <summary> ! /// When implemented by a class, gets the <see cref="Table"/> of the class ! /// that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="Table"/> of the class that is mapped in the <c>class</c> element. ! /// </value> public abstract Table RootTable { get; } ! /// <summary> ! /// When implemented by a class, gets the <see cref="RootClass"/> of the class ! /// that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="RootClass"/> of the class that is mapped in the <c>class</c> element. ! /// </value> public abstract RootClass RootClazz { get; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="Value"/> ! /// that contains information about the Key. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the Key.</value> public abstract Value Key { get; set; } /// <summary> ! /// Creates the <see cref="PrimaryKey"/> for the <see cref="Table"/> ! /// this type is persisted in. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> that is used to Alias columns.</param> public virtual void CreatePrimaryKey( Dialect.Dialect dialect ) { *************** *** 362,366 **** } ! /// <summary></summary> public abstract string Where { get; set; } --- 475,488 ---- } ! /// <summary> ! /// When implemented by a class, gets or sets the sql string that should ! /// be a part of the where clause. ! /// </summary> ! /// <value> ! /// The sql string that should be a part of the where clause. ! /// </value> ! /// <remarks> ! /// The value of this is set by the <c>where</c> attribute. ! /// </remarks> public abstract string Where { get; set; } Index: RootClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/RootClass.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** RootClass.cs 31 Dec 2004 21:27:54 -0000 1.11 --- RootClass.cs 3 Jan 2005 03:46:48 -0000 1.12 *************** *** 8,95 **** { /// <summary> ! /// Declaration of a System.Type by using the <c><class></c> element. /// </summary> - /// <remarks> - /// <p>The <c><class></c> element has the following attributes available:</p> - /// <list type="table"> - /// <listheader> - /// <term>Attribute</term> - /// <description>Possible Values</description> - /// </listheader> - /// <item> - /// <term>name</term> - /// <description>The fully qualified TypeName so it can be loaded by Reflection</description> - /// </item> - /// <item> - /// <term>table</term> - /// <description>The name of its database table.</description> - /// </item> - /// <item> - /// <term>discriminator-value</term> - /// <description> - /// (optional - defaults to the FullClassName) A value that distinguishes individual - /// subclasses, used for polymorphic behavior. - /// </description> - /// </item> - /// <item> - /// <term>mutable</term> - /// <description> - /// (optional - defaults to <c>true</c>) Specifies that instances of the class - /// are (not) mutable. - /// </description> - /// </item> - /// <item> - /// <term>schema</term> - /// <description>(optional) Override the schema name specified by the root <c><hibernate-mapping></c> element.</description> - /// </item> - /// <item> - /// <term>proxy</term> - /// <description> - /// (optional) Specifies an interface to use for lazy initializing proxies. - /// You may specify the name of the class itself. - /// (TODO: update once Proxies are implemented) - /// </description> - /// </item> - /// <item> - /// <term>dynamic-update</term> - /// <description> - /// (optional - defaults to <c>false</c>) Specifies the <c>UPDATE</c> SQL should - /// be generated at runtime and contain only those columns whose values have changed. - /// </description> - /// </item> - /// <item> - /// <term>dynamic-insert</term> - /// <description> - /// (optional - defaults to <c>false</c>) Specifies the <c>INSERT</c> SQL should - /// be generated at runtime and contain only those columns whose values are not null. - /// </description> - /// </item> - /// <item> - /// <term>polymorphism</term> - /// <description> - /// (optional, defaults to <c>implicit</c>) Determines whether implicit or explicit - /// query polymorphism is used. - /// </description> - /// </item> - /// <item> - /// <term>where</term> - /// <description> - /// (optional) Specify an arbitrary SQL <c>WHERE</c> condition to be used - /// when retrieving objects of this class. - /// </description> - /// </item> - /// <item> - /// <term>persister</term> - /// <description>(optional) Specifies a custom <see cref="IClassPersister"/>.</description> - /// </item> - /// </list> - /// </remarks> public class RootClass : PersistentClass { private static readonly ILog log = LogManager.GetLogger( typeof( RootClass ) ); ! /// <summary></summary> public const string DefaultIdentifierColumnName = "id"; ! /// <summary></summary> public const string DefaultDiscriminatorColumnName = "class"; --- 8,27 ---- { /// <summary> ! /// Declaration of a System.Type mapped with the <c><class></c> element. /// </summary> public class RootClass : PersistentClass { private static readonly ILog log = LogManager.GetLogger( typeof( RootClass ) ); ! /// <summary> ! /// The default name of the column for the Identifier ! /// </summary> ! /// <value><c>id</c> is the default column name for the Identifier.</value> public const string DefaultIdentifierColumnName = "id"; ! ! /// <summary> ! /// The default name of the column for the Discriminator ! /// </summary> ! /// <value><c>class</c> is the default column name for the Discriminator.</value> public const string DefaultDiscriminatorColumnName = "class"; *************** *** 107,117 **** private string where; ! /// <summary></summary> ! public bool Polymorphic ! { ! set { polymorphic = value; } ! } ! ! /// <summary></summary> public override Property IdentifierProperty { --- 39,48 ---- private string where; ! /// <summary> ! /// Gets or sets the <see cref="Property"/> that is used as the <c>id</c>. ! /// </summary> ! /// <value> ! /// The <see cref="Property"/> that is used as the <c>id</c>. ! /// </value> public override Property IdentifierProperty { *************** *** 120,124 **** } ! /// <summary></summary> public override Value Identifier { --- 51,58 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the identifier. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the identifier.</value> public override Value Identifier { *************** *** 127,131 **** } ! /// <summary></summary> public override bool HasIdentifierProperty { --- 61,68 ---- } ! /// <summary> ! /// Gets a boolean indicating if the mapped class has a Property for the <c>id</c>. ! /// </summary> ! /// <value><c>true</c> if there is a Property for the <c>id</c>.</value> public override bool HasIdentifierProperty { *************** *** 133,137 **** } ! /// <summary></summary> public override Value Discriminator { --- 70,77 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the discriminator. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the discriminator.</value> public override Value Discriminator { *************** *** 140,144 **** } ! /// <summary></summary> public override bool IsInherited { --- 80,89 ---- } ! /// <summary> ! /// Gets a boolean indicating if this mapped class is inherited from another. ! /// </summary> ! /// <value> ! /// <c>false</c> because this is the root mapped class. ! /// </value> public override bool IsInherited { *************** *** 147,162 **** /// <summary> ! /// Indicates if the object has subclasses /// </summary> ! /// <remarks> ! /// This value is set to True when a subclass is added and should not be set ! /// through any other method - so no setter is declared for this property. ! /// </remarks> public override bool IsPolymorphic { get { return polymorphic; } } ! /// <summary></summary> public override RootClass RootClazz { --- 92,112 ---- /// <summary> ! /// Gets or sets if the mapped class has subclasses. /// </summary> ! /// <value> ! /// <c>true</c> if the mapped class has subclasses. ! /// </value> public override bool IsPolymorphic { get { return polymorphic; } + set { polymorphic = value; } } ! /// <summary> ! /// Gets the <see cref="RootClass"/> of the class that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// <c>this</c> since this is the root mapped class. ! /// </value> public override RootClass RootClazz { *************** *** 164,168 **** } ! /// <summary></summary> public override ICollection PropertyClosureCollection { --- 114,124 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Property"/> objects that this mapped class contains. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains. ! /// </value> public override ICollection PropertyClosureCollection { *************** *** 171,178 **** /// <summary> ! /// Returns all of the Tables the Root class covers. /// </summary> /// <remarks> ! /// The RootClass should only have one item in the Collection - the Table that it comes from. /// </remarks> public override ICollection TableClosureCollection --- 127,140 ---- /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Table"/> objects that this ! /// mapped class reads from and writes to. /// </summary> + /// <value> + /// An <see cref="ICollection"/> of <see cref="Table"/> objects that + /// this mapped class reads from and writes to. + /// </value> /// <remarks> ! /// There is only one <see cref="Table"/> in the <see cref="ICollection"/> since ! /// this is the root class. /// </remarks> public override ICollection TableClosureCollection *************** *** 187,193 **** /// <summary> ! /// /// </summary> ! /// <param name="subclass"></param> public override void AddSubclass( Subclass subclass ) { --- 149,159 ---- /// <summary> ! /// Adds a <see cref="Subclass"/> to the class hierarchy. /// </summary> ! /// <param name="subclass">The <see cref="Subclass"/> to add to the hierarchy.</param> ! /// <remarks> ! /// When a <see cref="Subclass"/> is added this mapped class has the property <see cref="IsPolymorphic"/> ! /// set to <c>true</c>. ! /// </remarks> public override void AddSubclass( Subclass subclass ) { *************** *** 196,200 **** } ! /// <summary></summary> public override bool IsExplicitPolymorphism { --- 162,172 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if explicit polymorphism should be used in Queries. ! /// </summary> ! /// <value> ! /// <c>true</c> if only classes queried on should be returned, <c>false</c> ! /// if any class in the heirarchy should implicitly be returned. ! /// </value> public override bool IsExplicitPolymorphism { *************** *** 204,242 **** /// <summary> ! /// Gets or Sets the <see cref="Property"/> to use as the Version Property /// </summary> ! /// <value>The <see cref="Property"/> to use for Versioning.</value> ! /// <remarks> ! /// <para> ! /// The <version> element is optional and indicates that the table contains versioned data. ! /// This is particularly useful if you plan to use long transactions (see below). ! /// </para> ! /// <para> ! /// <list type="table"> ! /// <listheader> ! /// <term>Attribute</term> ! /// <description>Possible Values</description> ! /// </listheader> ! /// <item> ! /// <term>column</term> ! /// <description> ! /// The name of the <c>column</c> holding the version number. ! /// Defaults to the Property name. ! /// </description> ! /// </item> ! /// <item> ! /// <term>name</term> ! /// <description>The name of the Property in the Persistent Class.</description> ! /// </item> ! /// <item> ! /// <term>type</term> ! /// <description> ! /// The <see cref="Type.IType"/> of the Property. Defaults to an <see cref="Type.Int32Type"/>. It ! /// be any <see cref="Type.IVersionType"/>. ! /// </description> ! /// </item> ! /// </list> ! /// </para> ! /// </remarks> public override Property Version { --- 176,182 ---- /// <summary> ! /// Gets or sets the <see cref="Property"/> that is used as the version. /// </summary> ! /// <value>The <see cref="Property"/> that is used as the version.</value> public override Property Version { *************** *** 246,253 **** /// <summary> ! /// Gets a value indicating if the <see cref="PersistentClass" /> is versioned ! /// by NHibernate. /// </summary> ! /// <value><c>true</c> if there is a version property.</value> public override bool IsVersioned { --- 186,192 ---- /// <summary> ! /// Gets a boolean indicating if the mapped class has a version property. /// </summary> ! /// <value><c>true</c> if there is a Property for a <c>version</c>.</value> public override bool IsVersioned { *************** *** 255,259 **** } ! /// <summary></summary> public override ICacheConcurrencyStrategy Cache { --- 194,202 ---- } ! /// <summary> ! /// Gets or sets the <see cref="ICacheConcurrencyStrategy"/> ! /// to use to read/write instances of the persistent class to the Cache. ! /// </summary> ! /// <value>The <see cref="ICacheConcurrencyStrategy"/> used with the Cache.</value> public override ICacheConcurrencyStrategy Cache { *************** *** 262,266 **** } ! /// <summary></summary> public override bool IsMutable { --- 205,212 ---- } ! /// <summary> ! /// Gets or set a boolean indicating if the mapped class has properties that can be changed. ! /// </summary> ! /// <value><c>true</c> if the object is mutable.</value> public override bool IsMutable { *************** *** 269,273 **** } ! /// <summary></summary> public override bool HasEmbeddedIdentifier { --- 215,228 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if the identifier is ! /// embedded in the class. ! /// </summary> ! /// <value><c>true</c> if the class identifies itself.</value> ! /// <remarks> ! /// An embedded identifier is true when using a <c>composite-id</c> specifying ! /// properties of the class as the <c>key-property</c> instead of using a class ! /// as the <c>composite-id</c>. ! /// </remarks> public override bool HasEmbeddedIdentifier { *************** *** 276,280 **** } ! /// <summary></summary> public override System.Type Persister { --- 231,238 ---- } ! /// <summary> ! /// Gets or sets the <see cref="System.Type"/> of the Persister. ! /// </summary> ! /// <value>The <see cref="System.Type"/> of the Persister.</value> public override System.Type Persister { *************** *** 283,287 **** } ! /// <summary></summary> public override Table RootTable { --- 241,251 ---- } ! /// <summary> ! /// Gets the <see cref="Table"/> of the class ! /// that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="Table"/> of the class this mapped class. ! /// </value> public override Table RootTable { *************** *** 289,293 **** } ! /// <summary></summary> public override PersistentClass Superclass { --- 253,266 ---- } ! /// <summary> ! /// Gets or sets the <see cref="PersistentClass"/> that this mapped class is extending. ! /// </summary> ! /// <value> ! /// <c>null</c> since this is the root class. ! /// </value> ! /// <exception cref="InvalidOperationException"> ! /// Thrown when the setter is called. The Superclass can not be set on the ! /// RootClass, only the Subclass can have a Superclass set. ! /// </exception> public override PersistentClass Superclass { *************** *** 296,300 **** } ! /// <summary></summary> public override Value Key { --- 269,276 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the Key. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the Key.</value> public override Value Key { *************** *** 303,307 **** } ! /// <summary></summary> public override bool IsForceDiscriminator { --- 279,287 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if only values in the discriminator column that ! /// are mapped will be included in the sql. ! /// </summary> ! /// <value><c>true</c> if the mapped discriminator values should be forced.</value> public override bool IsForceDiscriminator { *************** *** 310,314 **** } ! /// <summary></summary> public override string Where { --- 290,299 ---- } ! /// <summary> ! /// Gets or sets the sql string that should be a part of the where clause. ! /// </summary> ! /// <value> ! /// The sql string that should be a part of the where clause. ! /// </value> public override string Where { Index: Subclass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Subclass.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Subclass.cs 31 Dec 2004 21:27:54 -0000 1.6 --- Subclass.cs 3 Jan 2005 03:46:48 -0000 1.7 *************** *** 5,9 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class Subclass : PersistentClass { --- 5,12 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// Declaration of a System.Type mapped with the <c><subclass></c> or ! /// <c><joined-subclass></c> element. ! /// </summary> public class Subclass : PersistentClass { *************** *** 12,18 **** /// <summary> ! /// /// </summary> ! /// <param name="superclass"></param> public Subclass( PersistentClass superclass ) { --- 15,21 ---- /// <summary> ! /// Initializes a new instance of the <see cref="Subclass"/> class. /// </summary> ! /// <param name="superclass">The <see cref="PersistentClass"/> that is the superclass.</param> public Subclass( PersistentClass superclass ) { *************** *** 20,24 **** } ! /// <summary></summary> public override ICacheConcurrencyStrategy Cache { --- 23,31 ---- } ! /// <summary> ! /// Gets or sets the <see cref="ICacheConcurrencyStrategy"/> ! /// to use to read/write instances of the persistent class to the Cache. ! /// </summary> ! /// <value>The <see cref="ICacheConcurrencyStrategy"/> that the Superclass uses with the Cache.</value> public override ICacheConcurrencyStrategy Cache { *************** *** 27,31 **** } ! /// <summary></summary> public override RootClass RootClazz { --- 34,43 ---- } ! /// <summary> ! /// Gets the <see cref="RootClass"/> of the class that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="RootClass"/> of the Superclass that is mapped in the <c>class</c> element. ! /// </value> public override RootClass RootClazz { *************** *** 33,37 **** } ! /// <summary></summary> public override PersistentClass Superclass { --- 45,54 ---- } ! /// <summary> ! /// Gets or sets the <see cref="PersistentClass"/> that this mapped class is extending. ! /// </summary> ! /// <value> ! /// The <see cref="PersistentClass"/> that this mapped class is extending. ! /// </value> public override PersistentClass Superclass { *************** *** 40,44 **** } ! /// <summary></summary> public override Property IdentifierProperty { --- 57,66 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Property"/> that is used as the <c>id</c>. ! /// </summary> ! /// <value> ! /// The <see cref="Property"/> from the Superclass that is used as the <c>id</c>. ! /// </value> public override Property IdentifierProperty { *************** *** 47,51 **** } ! /// <summary></summary> public override Value Identifier { --- 69,76 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the identifier. ! /// </summary> ! /// <value>The <see cref="Value"/> from the Superclass that contains information about the identifier.</value> public override Value Identifier { *************** *** 54,58 **** } ! /// <summary></summary> public override bool HasIdentifierProperty { --- 79,86 ---- } ! /// <summary> ! /// Gets a boolean indicating if the mapped class has a Property for the <c>id</c>. ! /// </summary> ! /// <value><c>true</c> if in the Superclass there is a Property for the <c>id</c>.</value> public override bool HasIdentifierProperty { *************** *** 60,64 **** } ! /// <summary></summary> public override Value Discriminator { --- 88,95 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the discriminator. ! /// </summary> ! /// <value>The <see cref="Value"/> from the Superclass that contains information about the discriminator.</value> public override Value Discriminator { *************** *** 67,71 **** } ! /// <summary></summary> public override bool IsMutable { --- 98,105 ---- } ! /// <summary> ! /// Gets or set a boolean indicating if the mapped class has properties that can be changed. ! /// </summary> ! /// <value><c>true</c> if the Superclass is mutable.</value> public override bool IsMutable { *************** *** 74,78 **** } ! /// <summary></summary> public override bool IsInherited { --- 108,117 ---- } ! /// <summary> ! /// Gets a boolean indicating if this mapped class is inherited from another. ! /// </summary> ! /// <value> ! /// <c>true</c> because this is a Subclass. ! /// </value> public override bool IsInherited { *************** *** 80,93 **** } ! /// <summary></summary> public override bool IsPolymorphic { get { return true; } } /// <summary> ! /// /// </summary> ! /// <param name="p"></param> public override void AddProperty( Property p ) { --- 119,151 ---- } ! /// <summary> ! /// Gets or sets if the mapped class is a subclass. ! /// </summary> ! /// <value> ! /// <c>true</c> since this mapped class is a subclass. ! /// </value> ! /// <remarks> ! /// The setter should not be used to set the value to anything but <c>true</c>. ! /// </remarks> public override bool IsPolymorphic { get { return true; } + set + { + if( value!=true ) + { + throw new AssertionFailure( "IsPolymorphic has to be true for subclasses. There is a bug in NHibernate somewhere." ); + } + } } /// <summary> ! /// Add the <see cref="Property"/> to this PersistentClass. /// </summary> ! /// <param name="p">The <see cref="Property"/> to add.</param> ! /// <remarks> ! /// This also adds the <see cref="Property"/> to the Superclass' collection ! /// of Subclass Properties. ! /// </remarks> public override void AddProperty( Property p ) { *************** *** 96,100 **** } ! /// <summary></summary> public override Table Table { --- 154,165 ---- } ! /// <summary> ! /// Gets or Sets the <see cref="Table"/> that this class is stored in. ! /// </summary> ! /// <value>The <see cref="Table"/> this class is stored in.</value> ! /// <remarks> ! /// This also adds the <see cref="Table"/> to the Superclass' collection ! /// of Subclass Tables. ! /// </remarks> public override Table Table { *************** *** 107,111 **** } ! /// <summary></summary> public override ICollection PropertyClosureCollection { --- 172,186 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Property"/> objects that this mapped class contains. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Property"/> objects that ! /// this mapped class contains. ! /// </value> ! /// <remarks> ! /// This is all of the properties of this mapped class and each mapped class that ! /// it is inheriting from. ! /// </remarks> public override ICollection PropertyClosureCollection { *************** *** 119,123 **** } ! /// <summary></summary> public override ICollection TableClosureCollection { --- 194,209 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Table"/> objects that this ! /// mapped class reads from and writes to. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Table"/> objects that ! /// this mapped class reads from and writes to. ! /// </value> ! /// <remarks> ! /// This is all of the tables of this mapped class and each mapped class that ! /// it is inheriting from. ! /// </remarks> public override ICollection TableClosureCollection { *************** *** 132,138 **** /// <summary> ! /// /// </summary> ! /// <param name="p"></param> public override void AddSubclassProperty( Property p ) { --- 218,228 ---- /// <summary> ! /// Adds a <see cref="Property"/> that is implemented by a subclass. /// </summary> ! /// <param name="p">The <see cref="Property"/> implemented by a subclass.</param> ! /// <remarks> ! /// This also adds the <see cref="Property"/> to the Superclass' collection ! /// of Subclass Properties. ! /// </remarks> public override void AddSubclassProperty( Property p ) { *************** *** 142,148 **** /// <summary> ! /// /// </summary> ! /// <param name="table"></param> public override void AddSubclassTable( Table table ) { --- 232,242 ---- /// <summary> ! /// Adds a <see cref="Table"/> that a subclass is stored in. /// </summary> ! /// <param name="table">The <see cref="Table"/> the subclass is stored in.</param> ! /// <remarks> ! /// This also adds the <see cref="Table"/> to the Superclass' collection ! /// of Subclass Tables. ! /// </remarks> public override void AddSubclassTable( Table table ) { *************** *** 151,155 **** } ! /// <summary></summary> public override bool IsVersioned { --- 245,252 ---- } ! /// <summary> ! /// Gets a boolean indicating if the mapped class has a version property. ! /// </summary> ! /// <value><c>true</c> if for the Superclass there is a Property for a <c>version</c>.</value> public override bool IsVersioned { *************** *** 157,161 **** } ! /// <summary></summary> public override Property Version { --- 254,261 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Property"/> that is used as the version. ! /// </summary> ! /// <value>The <see cref="Property"/> from the Superclass that is used as the version.</value> public override Property Version { *************** *** 164,168 **** } ! /// <summary></summary> public override bool HasEmbeddedIdentifier { --- 264,277 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if the identifier is ! /// embedded in the class. ! /// </summary> ! /// <value><c>true</c> if the Superclass has an embedded identifier.</value> ! /// <remarks> ! /// An embedded identifier is true when using a <c>composite-id</c> specifying ! /// properties of the class as the <c>key-property</c> instead of using a class ! /// as the <c>composite-id</c>. ! /// </remarks> public override bool HasEmbeddedIdentifier { *************** *** 171,175 **** } ! /// <summary></summary> public override System.Type Persister { --- 280,287 ---- } ! /// <summary> ! /// Gets or sets the <see cref="System.Type"/> of the Persister. ! /// </summary> ! /// <value>The <see cref="System.Type"/> of the Persister for the Superclass.</value> public override System.Type Persister { *************** *** 178,182 **** } ! /// <summary></summary> public override Table RootTable { --- 290,300 ---- } ! /// <summary> ! /// Gets the <see cref="Table"/> of the class ! /// that is mapped in the <c>class</c> element. ! /// </summary> ! /// <value> ! /// The <see cref="Table"/> of the Superclass that is mapped in the <c>class</c> element. ! /// </value> public override Table RootTable { *************** *** 184,188 **** } ! /// <summary></summary> public override Value Key { --- 302,309 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Value"/> that contains information about the Key. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the Key.</value> public override Value Key { *************** *** 201,205 **** } ! /// <summary></summary> public override bool IsExplicitPolymorphism { --- 322,331 ---- } ! /// <summary> ! /// Gets or sets a boolean indicating if explicit polymorphism should be used in Queries. ! /// </summary> ! /// <value> ! /// The value of the Superclasses <c>IsExplicitPolymorphism</c> property. ! /// </value> public override bool IsExplicitPolymorphism { *************** *** 208,216 **** } ! /// <summary></summary> public override string Where { get { return Superclass.Where; } ! set { throw new NotImplementedException( "The Where string can not be set on the Subclass - use the RootClass instead." ); } } --- 334,351 ---- } ! /// <summary> ! /// Gets the sql string that should be a part of the where clause. ! /// </summary> ! /// <value> ! /// The sql string that should be a part of the where clause. ! /// </value> ! /// <exception cref="InvalidOperationException"> ! /// Thrown when the setter is called. The where clause can not be set on the ! /// Subclass, only the RootClass. ! /// </exception> public override string Where { get { return Superclass.Where; } ! set { throw new InvalidOperationException( "The Where string can not be set on the Subclass - use the RootClass instead." ); } } |
From: Michael D. <mik...@us...> - 2005-01-03 03:46:56
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16646/NHibernate/Cfg Modified Files: Binder.cs Log Message: Added more xml comments. Removed the set property for Polymorphicto be part of the IsPolymorphic property. Index: Binder.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Binder.cs,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Binder.cs 16 Dec 2004 04:54:06 -0000 1.35 --- Binder.cs 3 Jan 2005 03:46:47 -0000 1.36 *************** *** 269,273 **** } } ! model.Polymorphic = true; if ( subnode.Attributes["force"] != null && "true".Equals( subnode.Attributes["force"].Value ) ) { --- 269,273 ---- } } ! model.IsPolymorphic = true; if ( subnode.Attributes["force"] != null && "true".Equals( subnode.Attributes["force"].Value ) ) { |
From: Michael D. <mik...@us...> - 2005-01-03 03:45:38
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16440/NHibernate/Util Modified Files: ReflectHelper.cs Log Message: Friendly exception thrown when a class is missing a default ctor. Index: ReflectHelper.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Util/ReflectHelper.cs,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ReflectHelper.cs 1 Jan 2005 02:40:02 -0000 1.20 --- ReflectHelper.cs 3 Jan 2005 03:45:28 -0000 1.21 *************** *** 18,22 **** private static System.Type[ ] NoClasses = new System.Type[0]; - // private static System.Type[ ] Object = new System.Type[ ] {typeof( object )}; // not used !?! /// <summary> --- 18,21 ---- *************** *** 112,120 **** /// <summary> ! /// /// </summary> ! /// <param name="theClass"></param> ! /// <param name="name"></param> ! /// <returns></returns> public static IType ReflectedPropertyType( System.Type theClass, string name ) { --- 111,121 ---- /// <summary> ! /// Get the NHibernate <see cref="IType" /> for the named property of the <see cref="System.Type"/>. /// </summary> ! /// <param name="theClass">The <see cref="System.Type"/> to find the Property in.</param> ! /// <param name="name">The name of the property/field to find in the class.</param> ! /// <returns> ! /// The NHibernate <see cref="IType"/> for the named property. ! /// </returns> public static IType ReflectedPropertyType( System.Type theClass, string name ) { *************** *** 155,162 **** /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <returns></returns> public static ConstructorInfo GetDefaultConstructor( System.Type type ) { --- 156,169 ---- /// <summary> ! /// Gets the default no arg constructor for the <see cref="System.Type"/>. /// </summary> ! /// <param name="type">The <see cref="System.Type"/> to find the constructor for.</param> ! /// <returns> ! /// The <see cref="ConstructorInfo"/> for the no argument constructor, or <c>null</c> if a ! /// default constructor could not be found. ! /// </returns> ! /// <exception cref="InstantiationException"> ! /// Thrown when there is a problem calling the method GetConstructor on <see cref="System.Type"/>. ! /// </exception> public static ConstructorInfo GetDefaultConstructor( System.Type type ) { *************** *** 170,174 **** catch( Exception ) { ! throw new PropertyNotFoundException( "Object class " + type.FullName + " must declare a default (no-arg) constructor" ); --- 177,181 ---- catch( Exception ) { ! throw new InstantiationException( "Object class " + type.FullName + " must declare a default (no-arg) constructor" ); *************** *** 177,184 **** /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <returns></returns> public static bool IsAbstractClass( System.Type type ) { --- 184,191 ---- /// <summary> ! /// Determines if the <see cref="System.Type"/> is a non creatable class. /// </summary> ! /// <param name="type">The <see cref="System.Type"/> to check.</param> ! /// <returns><c>true</c> if the <see cref="System.Type"/> is an Abstract Class or an Interface.</returns> public static bool IsAbstractClass( System.Type type ) { |
From: Michael D. <mik...@us...> - 2005-01-03 03:45:37
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16440/NHibernate/Persister Modified Files: AbstractEntityPersister.cs Log Message: Friendly exception thrown when a class is missing a default ctor. Index: AbstractEntityPersister.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Persister/AbstractEntityPersister.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** AbstractEntityPersister.cs 31 Dec 2004 21:49:23 -0000 1.30 --- AbstractEntityPersister.cs 3 Jan 2005 03:45:27 -0000 1.31 *************** *** 646,650 **** constructor = ReflectHelper.GetDefaultConstructor( mappedClass ); abstractClass = ReflectHelper.IsAbstractClass( mappedClass ); ! // IDENTIFIER --- 646,657 ---- constructor = ReflectHelper.GetDefaultConstructor( mappedClass ); abstractClass = ReflectHelper.IsAbstractClass( mappedClass ); ! ! // verify that the class has a default constructor if it is not abstract - it is considered ! // a mapping exception if the default ctor is missing. ! if( abstractClass==false && constructor==null ) ! { ! throw new MappingException( "The mapped class " + mappedClass.FullName + " must declare a default (no-arg) constructor." ); ! } ! // IDENTIFIER |
From: Michael D. <mik...@us...> - 2005-01-03 03:44:50
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16287/NHibernate/Cfg Modified Files: Configuration.cs Log Message: minor code tweak to use stuff built into framework. Index: Configuration.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Cfg/Configuration.cs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Configuration.cs 31 Dec 2004 15:54:07 -0000 1.26 --- Configuration.cs 3 Jan 2005 03:44:41 -0000 1.27 *************** *** 631,647 **** public ISessionFactory BuildSessionFactory() { - // Version check to determine which version of .NET is running - if( ( System.Environment.Version.Major == 1 ) - && ( System.Environment.Version.Minor == 0 ) ) - { - throw new HibernateException( "Wrong version of .NET framework is used, NHibernate is not to be used with versions prior to 1.1.4322" ); - } - SecondPassCompile(); ! Hashtable copy = new Hashtable(); ! foreach( DictionaryEntry de in properties ) ! { ! copy.Add( de.Key, de.Value ); ! } Settings settings = BuildSettings(); --- 631,636 ---- public ISessionFactory BuildSessionFactory() { SecondPassCompile(); ! Hashtable copy = new Hashtable( properties ); Settings settings = BuildSettings(); |
From: Michael D. <mik...@us...> - 2005-01-03 03:44:04
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16129/NHibernate.Test Modified Files: NHibernate.Test-1.1.csproj Log Message: Added a fixture to verify the exception thrown when a class is missing a default ctor is easy to read. Index: NHibernate.Test-1.1.csproj =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/NHibernate.Test-1.1.csproj,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** NHibernate.Test-1.1.csproj 1 Jan 2005 14:19:41 -0000 1.58 --- NHibernate.Test-1.1.csproj 3 Jan 2005 03:43:53 -0000 1.59 *************** *** 399,402 **** --- 399,416 ---- /> <File + RelPath = "MappingExceptions\MissingDefCtor.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File + RelPath = "MappingExceptions\MissingDefCtor.hbm.xml" + BuildAction = "EmbeddedResource" + /> + <File + RelPath = "MappingExceptions\MissingDefCtorFixture.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "MappingTest\TableFixture.cs" SubType = "Code" |
From: Michael D. <mik...@us...> - 2005-01-03 03:44:03
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/MappingExceptions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16129/NHibernate.Test/MappingExceptions Added Files: MissingDefCtor.cs MissingDefCtor.hbm.xml MissingDefCtorFixture.cs Log Message: Added a fixture to verify the exception thrown when a class is missing a default ctor is easy to read. --- NEW FILE: MissingDefCtor.hbm.xml --- (This appears to be a binary file; contents omitted.) --- NEW FILE: MissingDefCtor.cs --- using System; namespace NHibernate.Test.MappingExceptions { /// <summary> /// Summary description for MissingDefCtor. /// </summary> public class MissingDefCtor { private int _id; private string _something; public MissingDefCtor(string something) { _something = something; } public int Id { get { return _id; } set { _id = value; } } public string Something { get { return _something; } set { _something = value; } } } } --- NEW FILE: MissingDefCtorFixture.cs --- using System; using NHibernate.Cfg; using NUnit.Framework; namespace NHibernate.Test.MappingExceptions { /// <summary> /// A TestFixture to verify the Exception thrown when a mapped class is missing the default /// ctor is readable and understandable. /// </summary> [TestFixture] public class MissingDefCtorFixture { [Test] public void ClassMissingDefaultCtor() { bool excCaught = false; // add a resource that doesn't exist string resource = "NHibernate.Test.MappingExceptions.MissingDefCtor.hbm.xml"; Configuration cfg = new Configuration(); try { cfg.AddResource( resource, this.GetType().Assembly ); cfg.BuildSessionFactory(); } catch( MappingException me ) { Assert.AreEqual( "The mapped class NHibernate.Test.MappingExceptions.MissingDefCtor must declare a default (no-arg) constructor.", me.Message ); excCaught = true; } Assert.IsTrue( excCaught, "Should have caught the MappingException about default ctor being missing." ); } } } |
From: Michael D. <mik...@us...> - 2005-01-02 22:03:51
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12379/NHibernate/Mapping Modified Files: Column.cs Constraint.cs ForeignKey.cs Formula.cs Index.cs IRelationalModel.cs PersistentClass.cs PrimaryKey.cs Table.cs UniqueKey.cs Log Message: Added some xml comments. Index: PersistentClass.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/PersistentClass.cs,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PersistentClass.cs 31 Dec 2004 21:27:42 -0000 1.15 --- PersistentClass.cs 2 Jan 2005 22:03:39 -0000 1.16 *************** *** 7,12 **** { /// <summary> ! /// Base class for the <see cref="RootClass" /> mapped by <class> and a ! /// <see cref="Subclass"/> that is mapped by <subclass> or <joined-subclass> /// </summary> public abstract class PersistentClass --- 7,13 ---- { /// <summary> ! /// Base class for the <see cref="RootClass" /> mapped by <c><class></c> and a ! /// <see cref="Subclass"/> that is mapped by <c><subclass></c> or ! /// <c><joined-subclass></c>. /// </summary> public abstract class PersistentClass *************** *** 58,62 **** /// </value> /// <remarks> ! /// The value of this is set by the <c>discriminator-value</c> attribute. Each <subclass> /// in a heirarchy must define a unique <c>discriminator-value</c>. The default value /// is the class name if no value is supplied. --- 59,63 ---- /// </value> /// <remarks> ! /// The value of this is set by the <c>discriminator-value</c> attribute. Each <c><subclass></c> /// in a heirarchy must define a unique <c>discriminator-value</c>. The default value /// is the class name if no value is supplied. *************** *** 69,75 **** /// <summary> ! /// /// </summary> ! /// <param name="subclass"></param> public virtual void AddSubclass( Subclass subclass ) { --- 70,76 ---- /// <summary> ! /// Adds a <see cref="Subclass"/> to the class hierarchy. /// </summary> ! /// <param name="subclass">The <see cref="Subclass"/> to add to the hierarchy.</param> public virtual void AddSubclass( Subclass subclass ) { *************** *** 77,81 **** } ! /// <summary></summary> public virtual bool HasSubclasses { --- 78,85 ---- } ! /// <summary> ! /// Gets a boolean indicating if this PersistentClass has any subclasses. ! /// </summary> ! /// <value><c>true</c> if this PeristentClass has any subclasses.</value> public virtual bool HasSubclasses { *************** *** 83,87 **** } ! /// <summary></summary> public virtual int SubclassSpan { --- 87,94 ---- } ! /// <summary> ! /// Gets the number of subclasses that inherit either directly or indirectly. ! /// </summary> ! /// <value>The number of subclasses that inherit from this PersistentClass.</value> public virtual int SubclassSpan { *************** *** 100,107 **** /// Gets the Collection of Subclasses for this PersistentClass. /// </summary> ! /// <remarks> /// It will recursively go through Subclasses so that if a Subclass has Subclasses /// it will pick those up also. ! /// </remarks> public virtual ICollection SubclassCollection { --- 107,114 ---- /// Gets the Collection of Subclasses for this PersistentClass. /// </summary> ! /// <value> /// It will recursively go through Subclasses so that if a Subclass has Subclasses /// it will pick those up also. ! /// </value> public virtual ICollection SubclassCollection { *************** *** 125,129 **** } ! /// <summary></summary> public virtual ICollection DirectSubclasses { --- 132,143 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Subclass"/> objects ! /// that directly inherit from this PersistentClass. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Subclass"/> objects ! /// that directly inherit from this PersistentClass. ! /// </value> public virtual ICollection DirectSubclasses { *************** *** 132,138 **** /// <summary> ! /// /// </summary> ! /// <param name="p"></param> public virtual void AddProperty( Property p ) { --- 146,152 ---- /// <summary> ! /// Add the <see cref="Property"/> to this PersistentClass. /// </summary> ! /// <param name="p">The <see cref="Property"/> to add.</param> public virtual void AddProperty( Property p ) { *************** *** 153,157 **** } ! /// <summary></summary> public virtual ICollection PropertyCollection { --- 167,176 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Property"/> objects. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Property"/> objects. ! /// </value> public virtual ICollection PropertyCollection { *************** *** 159,163 **** } ! /// <summary></summary> public virtual System.Type PersistentClazz { --- 178,189 ---- } ! /// <summary> ! /// Gets the <see cref="System.Type"/> that is being mapped. ! /// </summary> ! /// <value>The <see cref="System.Type"/> that is being mapped.</value> ! /// <remarks> ! /// The value of this is set by the <c>name</c> attribute on the <c><class></c> ! /// element. ! /// </remarks> public virtual System.Type PersistentClazz { *************** *** 166,170 **** } ! /// <summary></summary> public virtual string Name { --- 192,199 ---- } ! /// <summary> ! /// Gets the fully qualified name of the type being persisted. ! /// </summary> ! /// <value>The fully qualified name of the type being persisted.</value> public virtual string Name { *************** *** 172,191 **** } ! /// <summary></summary> public abstract bool IsMutable { get; set; } ! /// <summary></summary> public abstract bool HasIdentifierProperty { get; } ! /// <summary></summary> public abstract Property IdentifierProperty { get; set; } ! /// <summary></summary> public abstract Value Identifier { get; set; } ! /// <summary></summary> public abstract Property Version { get; set; } ! /// <summary></summary> public abstract Value Discriminator { get; set; } --- 201,246 ---- } ! /// <summary> ! /// When implemented by a class, gets or set a boolean indicating ! /// if the PersistentClass has properties that can be changed. ! /// </summary> ! /// <value><c>true</c> if the object is mutable.</value> public abstract bool IsMutable { get; set; } ! /// <summary> ! /// When implemented by a class, gets a boolean indicating ! /// if the PersistentClass has a Property for the <c>id</c>. ! /// </summary> ! /// <value><c>true</c> if there is a Property for the <c>id</c>.</value> public abstract bool HasIdentifierProperty { get; } ! /// <summary> ! /// When implemented by a class, gets the <see cref="Property"/> ! /// that is used as the <c>id</c>. ! /// </summary> ! /// <value> ! /// The <see cref="Property"/> that is used as the <c>id</c>. ! /// </value> public abstract Property IdentifierProperty { get; set; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="Value"/> ! /// that contains information about the identifier. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the identifier.</value> public abstract Value Identifier { get; set; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="Property"/> ! /// that is used as the version. ! /// </summary> ! /// <value>The <see cref="Property"/> that is used as the version.</value> public abstract Property Version { get; set; } ! /// <summary> ! /// When implemented by a class, gets or sets the <see cref="Value"/> ! /// that contains information about the discriminator. ! /// </summary> ! /// <value>The <see cref="Value"/> that contains information about the discriminator.</value> public abstract Value Discriminator { get; set; } Index: IRelationalModel.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/IRelationalModel.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IRelationalModel.cs 31 Dec 2004 21:27:02 -0000 1.3 --- IRelationalModel.cs 2 Jan 2005 22:03:39 -0000 1.4 *************** *** 3,22 **** namespace NHibernate.Mapping { ! /// <summary></summary> public interface IRelationalModel { /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> /// <param name="p"></param> ! /// <returns></returns> string SqlCreateString( Dialect.Dialect dialect, IMapping p ); /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> string SqlDropString( Dialect.Dialect dialect ); } --- 3,30 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// Operations to create/drop the mapping element in the database. ! /// </summary> public interface IRelationalModel { /// <summary> ! /// When implemented by a class, generates the SQL string to create ! /// the mapping element in the database. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> /// <param name="p"></param> ! /// <returns> ! /// A string that contains the SQL to create an object. ! /// </returns> string SqlCreateString( Dialect.Dialect dialect, IMapping p ); /// <summary> ! /// When implemented by a class, generates the SQL string to drop ! /// the mapping element from the database. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <returns> ! /// A string that contains the SQL to drop an object. ! /// </returns> string SqlDropString( Dialect.Dialect dialect ); } Index: ForeignKey.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/ForeignKey.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ForeignKey.cs 31 Dec 2004 21:26:49 -0000 1.6 --- ForeignKey.cs 2 Jan 2005 22:03:39 -0000 1.7 *************** *** 3,7 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class ForeignKey : Constraint { --- 3,9 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// A Foreign Key constraint in the database. ! /// </summary> public class ForeignKey : Constraint { *************** *** 9,13 **** private System.Type referencedClass; ! /// <summary></summary> public ForeignKey() { --- 11,17 ---- private System.Type referencedClass; ! /// <summary> ! /// Initializes a new instance of the <see cref="ForeignKey"/> class. ! /// </summary> public ForeignKey() { *************** *** 15,23 **** /// <summary> ! /// /// </summary> ! /// <param name="d"></param> ! /// <param name="constraintName"></param> ! /// <returns></returns> public override string SqlConstraintString( Dialect.Dialect d, string constraintName ) { --- 19,29 ---- /// <summary> ! /// Generates the SQL string to create the named Foreign Key Constraint in the database. /// </summary> ! /// <param name="d">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <param name="constraintName">The name to use as the identifier of the constraint in the database.</param> ! /// <returns> ! /// A string that contains the SQL to create the named Foreign Key Constraint. ! /// </returns> public override string SqlConstraintString( Dialect.Dialect d, string constraintName ) { *************** *** 42,46 **** } ! /// <summary></summary> public Table ReferencedTable { --- 48,59 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Table"/> that the Foreign Key is referencing. ! /// </summary> ! /// <value>The <see cref="Table"/> the Foreign Key is referencing.</value> ! /// <exception cref="MappingException"> ! /// Thrown when the number of columns in this Foreign Key is not the same ! /// amount of columns as the Primary Key in the ReferencedTable. ! /// </exception> public Table ReferencedTable { *************** *** 65,69 **** } ! /// <summary></summary> public System.Type ReferencedClass { --- 78,87 ---- } ! /// <summary> ! /// Gets or sets the <see cref="System.Type"/> that this Foreign Key is referencing. ! /// </summary> ! /// <value> ! /// The <see cref="System.Type"/> that this Foreign Key is referencing. ! /// </value> public System.Type ReferencedClass { Index: UniqueKey.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/UniqueKey.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UniqueKey.cs 31 Dec 2004 21:28:13 -0000 1.5 --- UniqueKey.cs 2 Jan 2005 22:03:39 -0000 1.6 *************** *** 4,15 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class UniqueKey : Constraint { /// <summary> ! /// /// </summary> ! /// <param name="d"></param> ! /// <returns></returns> public string SqlConstraintString( Dialect.Dialect d ) { --- 4,19 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// An Unique Key constraint in the database. ! /// </summary> public class UniqueKey : Constraint { /// <summary> ! /// Generates the SQL string to create the Unique Key Constraint in the database. /// </summary> ! /// <param name="d">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <returns> ! /// A string that contains the SQL to create the Unique Key Constraint. ! /// </returns> public string SqlConstraintString( Dialect.Dialect d ) { *************** *** 33,41 **** /// <summary> ! /// /// </summary> ! /// <param name="d"></param> ! /// <param name="constraintName"></param> ! /// <returns></returns> public override string SqlConstraintString( Dialect.Dialect d, string constraintName ) { --- 37,46 ---- /// <summary> ! /// Generates the SQL string to create the Unique Key Constraint in the database. /// </summary> ! /// <param name="d">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <returns> ! /// A string that contains the SQL to create the Unique Key Constraint. ! /// </returns> public override string SqlConstraintString( Dialect.Dialect d, string constraintName ) { Index: Column.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Column.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Column.cs 31 Dec 2004 21:26:38 -0000 1.14 --- Column.cs 2 Jan 2005 22:03:39 -0000 1.15 *************** *** 8,12 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class Column { --- 8,14 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// Represents the mapping to a column in a database. ! /// </summary> public class Column { *************** *** 25,29 **** internal int uniqueInteger; ! /// <summary></summary> public int Length { --- 27,34 ---- internal int uniqueInteger; ! /// <summary> ! /// Gets or sets the length of the datatype in the database. ! /// </summary> ! /// <value>The length of the datatype in the database.</value> public int Length { *************** *** 32,36 **** } ! /// <summary></summary> public IType Type { --- 37,46 ---- } ! /// <summary> ! /// Gets or sets the NHibernate <see cref="IType"/> of the column. ! /// </summary> ! /// <value> ! /// The NHibernate <see cref="IType"/> of the column. ! /// </value> public IType Type { *************** *** 39,43 **** } ! /// <summary></summary> public string Name { --- 49,70 ---- } ! /// <summary> ! /// Gets or sets the name of the column in the database. ! /// </summary> ! /// <value> ! /// The name of the column in the database. The get does ! /// not return a Quoted column name. ! /// </value> ! /// <remarks> ! /// <p> ! /// If a value is passed in that is wrapped by <c>`</c> then ! /// NHibernate will Quote the column whenever SQL is generated ! /// for it. How the column is quoted depends on the Dialect. ! /// </p> ! /// <p> ! /// The value returned by the getter is not Quoted. To get the ! /// column name in quoted form use <see cref="GetQuotedName(Dialect.Dialect)"/>. ! /// </p> ! /// </remarks> public string Name { *************** *** 58,65 **** /// <summary> ! /// /// </summary> ! /// <param name="d"></param> ! /// <returns></returns> public string GetQuotedName( Dialect.Dialect d ) { --- 85,98 ---- /// <summary> ! /// Gets the name of this Column in quoted form if it is necessary. /// </summary> ! /// <param name="d"> ! /// The <see cref="Dialect.Dialect"/> that knows how to quote ! /// the column name. ! /// </param> ! /// <returns> ! /// The column name in a form that is safe to use inside of a SQL statement. ! /// Quoted if it needs to be, not quoted if it does not need to be. ! /// </returns> public string GetQuotedName( Dialect.Dialect d ) { *************** *** 70,77 **** /// <summary> ! /// /// </summary> ! /// <param name="d"></param> ! /// <returns></returns> public string Alias( Dialect.Dialect d ) { --- 103,112 ---- /// <summary> ! /// Gets an Alias for the column name. /// </summary> ! /// <param name="d">The <see cref="Dialect.Dialect"/> that contains the rules for Aliasing.</param> ! /// <returns> ! /// A string that can be used as the alias for this Column. ! /// </returns> public string Alias( Dialect.Dialect d ) { *************** *** 92,100 **** /// <summary> ! /// /// </summary> ! /// <param name="d"></param> ! /// <param name="suffix"></param> ! /// <returns></returns> public string Alias( Dialect.Dialect d, string suffix ) { --- 127,137 ---- /// <summary> ! /// Gets an Alias for the column name. /// </summary> ! /// <param name="d">The <see cref="Dialect.Dialect"/> that contains the rules for Aliasing.</param> ! /// <param name="suffix">A string to use as the suffix for the Alias.</param> ! /// <returns> ! /// A string that can be used as the alias for this Column. ! /// </returns> public string Alias( Dialect.Dialect d, string suffix ) { *************** *** 108,112 **** return name + suffix; } - //return name.Substring(0, name.Length - suffix.Length); else { --- 145,148 ---- *************** *** 116,120 **** } ! /// <summary></summary> public bool IsNullable { --- 152,159 ---- } ! /// <summary> ! /// Gets or sets if the column can have null values in it. ! /// </summary> ! /// <value><c>true</c> if the column can have a null value in it.</value> public bool IsNullable { *************** *** 124,131 **** /// <summary> ! /// /// </summary> ! /// <param name="type"></param> ! /// <param name="typeIndex"></param> public Column( IType type, int typeIndex ) { --- 163,170 ---- /// <summary> ! /// Initializes a new instance of <see cref="Column"/>. /// </summary> ! /// <param name="type">The NHibernate <see cref="IType"/> that reads from and writes to the column.</param> ! /// <param name="typeIndex">The index of the column in the <see cref="IType"/>.</param> public Column( IType type, int typeIndex ) { *************** *** 134,138 **** } ! /// <summary></summary> public int TypeIndex { --- 173,182 ---- } ! /// <summary> ! /// Gets or sets the index of the column in the <see cref="IType"/>. ! /// </summary> ! /// <value> ! /// The index of the column in the <see cref="IType"/>. ! /// </value> public int TypeIndex { *************** *** 142,149 **** /// <summary> ! /// /// </summary> /// <param name="mapping"></param> ! /// <returns></returns> public SqlType GetAutoSqlType( IMapping mapping ) { --- 186,195 ---- /// <summary> ! /// Gets the <see cref="SqlType"/> of the column based on the <see cref="IType"/>. /// </summary> /// <param name="mapping"></param> ! /// <returns> ! /// The <see cref="SqlType"/> of the column based on the <see cref="IType"/>. ! /// </returns> public SqlType GetAutoSqlType( IMapping mapping ) { *************** *** 164,168 **** } ! /// <summary></summary> public bool IsUnique { --- 210,217 ---- } ! /// <summary> ! /// Gets or sets if the column contains unique values. ! /// </summary> ! /// <value><c>true</c> if the column contains unique values.</value> public bool IsUnique { *************** *** 172,180 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> /// <param name="mapping"></param> ! /// <returns></returns> public string GetSqlType( Dialect.Dialect dialect, IMapping mapping ) { --- 221,236 ---- /// <summary> ! /// Gets the name of the data type for the column. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use to get the valid data types.</param> /// <param name="mapping"></param> ! /// <returns> ! /// The name of the data type for the column. ! /// </returns> ! /// <remarks> ! /// If the mapping file contains a value of the attribute <c>sql-type</c> this will ! /// return the string contained in that attribute. Otherwise it will use the ! /// typename from the <see cref="Dialect.Dialect"/> of the <see cref="SqlType"/> object. ! /// </remarks> public string GetSqlType( Dialect.Dialect dialect, IMapping mapping ) { *************** *** 190,198 **** } /// <summary> ! /// /// </summary> ! /// <param name="obj"></param> ! /// <returns></returns> public override bool Equals( object obj ) { --- 246,260 ---- } + #region System.Object Members + /// <summary> ! /// Determines if this instance of <see cref="Column"/> and a specified object, ! /// which must be a <b>Column</b> can be considered the same. /// </summary> ! /// <param name="obj">An <see cref="Object"/> that should be a <see cref="Column"/>.</param> ! /// <returns> ! /// <c>true</c> if the name of this Column and the other Column are the same, ! /// otherwise <c>false</c>. ! /// </returns> public override bool Equals( object obj ) { *************** *** 201,208 **** /// <summary> ! /// /// </summary> ! /// <param name="column"></param> ! /// <returns></returns> public bool Equals( Column column ) { --- 263,274 ---- /// <summary> ! /// Determines if this instance of <see cref="Column"/> and the specified Column ! /// can be considered the same. /// </summary> ! /// <param name="column">A <see cref="Column"/> to compare to this Column.</param> ! /// <returns> ! /// <c>true</c> if the name of this Column and the other Column are the same, ! /// otherwise <c>false</c>. ! /// </returns> public bool Equals( Column column ) { *************** *** 219,223 **** } ! /// <summary></summary> public override int GetHashCode() { --- 285,292 ---- } ! /// <summary> ! /// Returns the hash code for this instance. ! /// </summary> ! /// <value>The value of <see cref="Name.GetHashCode()">Name.GetHashCode()</see>.</value> public override int GetHashCode() { *************** *** 225,229 **** } ! /// <summary></summary> public string SqlType { --- 294,308 ---- } ! #endregion ! ! /// <summary> ! /// Gets or sets the sql data type name of the column. ! /// </summary> ! /// <value> ! /// The sql data type name of the column. ! /// </value> ! /// <remarks> ! /// This is usually read from the <c>sql-type</c> attribute. ! /// </remarks> public string SqlType { *************** *** 232,236 **** } ! /// <summary></summary> public bool IsQuoted { --- 311,318 ---- } ! /// <summary> ! /// Gets or sets if the column needs to be quoted in SQL statements. ! /// </summary> ! /// <value><c>true</c> if the column is quoted.</value> public bool IsQuoted { Index: PrimaryKey.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/PrimaryKey.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PrimaryKey.cs 31 Dec 2004 21:27:42 -0000 1.6 --- PrimaryKey.cs 2 Jan 2005 22:03:39 -0000 1.7 *************** *** 4,15 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class PrimaryKey : Constraint { /// <summary> ! /// /// </summary> ! /// <param name="d"></param> ! /// <returns></returns> public string SqlConstraintString( Dialect.Dialect d ) { --- 4,19 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// A Primary Key constraint in the database. ! /// </summary> public class PrimaryKey : Constraint { /// <summary> ! /// Generates the SQL string to create the Primary Key Constraint in the database. /// </summary> ! /// <param name="d">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <returns> ! /// A string that contains the SQL to create the Primary Key Constraint. ! /// </returns> public string SqlConstraintString( Dialect.Dialect d ) { *************** *** 29,37 **** /// <summary> ! /// /// </summary> ! /// <param name="d"></param> ! /// <param name="constraintName"></param> ! /// <returns></returns> public override string SqlConstraintString( Dialect.Dialect d, string constraintName ) { --- 33,43 ---- /// <summary> ! /// Generates the SQL string to create the named Primary Key Constraint in the database. /// </summary> ! /// <param name="d">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <param name="constraintName">The name to use as the identifier of the constraint in the database.</param> ! /// <returns> ! /// A string that contains the SQL to create the named Primary Key Constraint. ! /// </returns> public override string SqlConstraintString( Dialect.Dialect d, string constraintName ) { Index: Index.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Index.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Index.cs 31 Dec 2004 21:27:02 -0000 1.5 --- Index.cs 2 Jan 2005 22:03:39 -0000 1.6 *************** *** 6,10 **** namespace NHibernate.Mapping { ! /// <summary></summary> public class Index : IRelationalModel { --- 6,12 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// An Index in the database. ! /// </summary> public class Index : IRelationalModel { *************** *** 14,22 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> /// <param name="p"></param> ! /// <returns></returns> public string SqlCreateString( Dialect.Dialect dialect, IMapping p ) { --- 16,26 ---- /// <summary> ! /// Generates the SQL string to create this Index in the database. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> /// <param name="p"></param> ! /// <returns> ! /// A string that contains the SQL to create this Index. ! /// </returns> public string SqlCreateString( Dialect.Dialect dialect, IMapping p ) { *************** *** 44,51 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> public string SqlDropString( Dialect.Dialect dialect ) { --- 48,57 ---- /// <summary> ! /// Generates the SQL string to drop this Index in the database. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <returns> ! /// A string that contains the SQL to drop this Index. ! /// </returns> public string SqlDropString( Dialect.Dialect dialect ) { *************** *** 53,57 **** } ! /// <summary></summary> public Table Table { --- 59,68 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Table"/> this Index is in. ! /// </summary> ! /// <value> ! /// The <see cref="Table"/> this Index is in. ! /// </value> public Table Table { *************** *** 60,64 **** } ! /// <summary></summary> public ICollection ColumnCollection { --- 71,82 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Column"/> objects that are ! /// part of the Index. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Column"/> objects that are ! /// part of the Index. ! /// </value> public ICollection ColumnCollection { *************** *** 67,73 **** /// <summary> ! /// /// </summary> ! /// <param name="column"></param> public void AddColumn( Column column ) { --- 85,92 ---- /// <summary> ! /// Adds the <see cref="Column"/> to the <see cref="ICollection"/> of ! /// Columns that are part of the Index. /// </summary> ! /// <param name="column">The <see cref="Column"/> to include in the Index.</param> public void AddColumn( Column column ) { *************** *** 78,82 **** } ! /// <summary></summary> public string Name { --- 97,104 ---- } ! /// <summary> ! /// Gets or sets the Name used to identify the Index in the database. ! /// </summary> ! /// <value>The Name used to identify the Index in the database.</value> public string Name { Index: Constraint.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Constraint.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Constraint.cs 31 Dec 2004 21:26:38 -0000 1.5 --- Constraint.cs 2 Jan 2005 22:03:39 -0000 1.6 *************** *** 5,9 **** namespace NHibernate.Mapping { ! /// <summary></summary> public abstract class Constraint : IRelationalModel { --- 5,11 ---- namespace NHibernate.Mapping { ! /// <summary> ! /// Base class for Constraints in the database. ! /// </summary> public abstract class Constraint : IRelationalModel { *************** *** 12,16 **** private Table table; ! /// <summary></summary> public string Name { --- 14,21 ---- private Table table; ! /// <summary> ! /// Gets or sets the Name used to identify the constraint in the database. ! /// </summary> ! /// <value>The Name used to identify the constraint in the database.</value> public string Name { *************** *** 19,23 **** } ! /// <summary></summary> public ICollection ColumnCollection { --- 24,33 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Column"/> objects that are part of the constraint. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Column"/> objects that are part of the constraint. ! /// </value> public ICollection ColumnCollection { *************** *** 26,32 **** /// <summary> ! /// /// </summary> ! /// <param name="column"></param> public void AddColumn( Column column ) { --- 36,43 ---- /// <summary> ! /// Adds the <see cref="Column"/> to the <see cref="ICollection"/> of ! /// Columns that are part of the constraint. /// </summary> ! /// <param name="column">The <see cref="Column"/> to include in the Constraint.</param> public void AddColumn( Column column ) { *************** *** 37,41 **** } ! /// <summary></summary> public int ColumnSpan { --- 48,57 ---- } ! /// <summary> ! /// Gets the number of columns that this Constraint contains. ! /// </summary> ! /// <value> ! /// The number of columns that this Constraint contains. ! /// </value> public int ColumnSpan { *************** *** 43,47 **** } ! /// <summary></summary> public Table Table { --- 59,68 ---- } ! /// <summary> ! /// Gets or sets the <see cref="Table"/> this Constraint is in. ! /// </summary> ! /// <value> ! /// The <see cref="Table"/> this Constraint is in. ! /// </value> public Table Table { *************** *** 50,58 **** } /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> public string SqlDropString( Dialect.Dialect dialect ) { --- 71,83 ---- } + #region IRelationModel Members + /// <summary> ! /// Generates the SQL string to drop this Constraint in the database. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <returns> ! /// A string that contains the SQL to drop this Constraint. ! /// </returns> public string SqlDropString( Dialect.Dialect dialect ) { *************** *** 61,69 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> /// <param name="p"></param> ! /// <returns></returns> public string SqlCreateString( Dialect.Dialect dialect, IMapping p ) { --- 86,96 ---- /// <summary> ! /// Generates the SQL string to create this Constraint in the database. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> /// <param name="p"></param> ! /// <returns> ! /// A string that contains the SQL to create this Constraint. ! /// </returns> public string SqlCreateString( Dialect.Dialect dialect, IMapping p ) { *************** *** 74,83 **** } /// <summary> ! /// /// </summary> ! /// <param name="d"></param> ! /// <param name="constraintName"></param> ! /// <returns></returns> public abstract string SqlConstraintString( Dialect.Dialect d, string constraintName ); --- 101,115 ---- } + #endregion + /// <summary> ! /// When implemented by a class, generates the SQL string to create the named ! /// Constraint in the database. /// </summary> ! /// <param name="d">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <param name="constraintName">The name to use as the identifier of the constraint in the database.</param> ! /// <returns> ! /// A string that contains the SQL to create the named Constraint. ! /// </returns> public abstract string SqlConstraintString( Dialect.Dialect d, string constraintName ); Index: Table.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Table.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Table.cs 31 Dec 2004 21:28:13 -0000 1.14 --- Table.cs 2 Jan 2005 22:03:39 -0000 1.15 *************** *** 1,2 **** --- 1,3 ---- + using System; using System.Collections; using System.Data; *************** *** 25,29 **** private static int tableCounter = 0; ! /// <summary></summary> public Table() { --- 26,32 ---- private static int tableCounter = 0; ! /// <summary> ! /// Initializes a new instance of <see cref="Table"/>. ! /// </summary> public Table() { *************** *** 32,39 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> public string GetQualifiedName( Dialect.Dialect dialect ) { --- 35,42 ---- /// <summary> ! /// Gets the schema qualified name of the Table. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> that knows how to Quote the Table name.</param> ! /// <returns>The name of the table qualified with the schema if one is specified.</returns> public string GetQualifiedName( Dialect.Dialect dialect ) { *************** *** 44,50 **** /// <summary> ! /// Returns the QualifiedName for the table using the specified Qualifier /// </summary> ! /// <param name="dialect"></param> /// <param name="defaultQualifier">The Qualifier to use when accessing the table.</param> /// <returns>A String representing the Qualified name.</returns> --- 47,53 ---- /// <summary> ! /// Gets the schema qualified name of the Table using the specified qualifier /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> that knows how to Quote the Table name.</param> /// <param name="defaultQualifier">The Qualifier to use when accessing the table.</param> /// <returns>A String representing the Qualified name.</returns> *************** *** 58,62 **** } ! /// <summary></summary> public string Name { --- 61,82 ---- } ! /// <summary> ! /// Gets or sets the name of the Table in the database. ! /// </summary> ! /// <value> ! /// The name of the Table in the database. The get does ! /// not return a Quoted Table name. ! /// </value> ! /// <remarks> ! /// <p> ! /// If a value is passed in that is wrapped by <c>`</c> then ! /// NHibernate will Quote the Table whenever SQL is generated ! /// for it. How the Table is quoted depends on the Dialect. ! /// </p> ! /// <p> ! /// The value returned by the getter is not Quoted. To get the ! /// column name in quoted form use <see cref="GetQuotedName(Dialect.Dialect)"/>. ! /// </p> ! /// </remarks> public string Name { *************** *** 77,84 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> public string GetQuotedName( Dialect.Dialect dialect ) { --- 97,109 ---- /// <summary> ! /// Gets the name of this Table in quoted form if it is necessary. /// </summary> ! /// <param name="dialect"> ! /// The <see cref="Dialect.Dialect"/> that knows how to quote the Table name. ! /// </param> ! /// <returns> ! /// The Table name in a form that is safe to use inside of a SQL statement. ! /// Quoted if it needs to be, not quoted if it does not need to be. ! /// </returns> public string GetQuotedName( Dialect.Dialect dialect ) { *************** *** 89,96 **** /// <summary> ! /// /// </summary> ! /// <param name="n"></param> ! /// <returns></returns> public Column GetColumn( int n ) { --- 114,123 ---- /// <summary> ! /// Gets the <see cref="Column"/> at the specified index. /// </summary> ! /// <param name="n">The index of the Column to get.</param> ! /// <returns> ! /// The <see cref="Column"/> at the specified index. ! /// </returns> public Column GetColumn( int n ) { *************** *** 104,110 **** /// <summary> ! /// /// </summary> ! /// <param name="column"></param> public void AddColumn( Column column ) { --- 131,138 ---- /// <summary> ! /// Adds the <see cref="Column"/> to the <see cref="ICollection"/> of ! /// Columns that are part of the Table. /// </summary> ! /// <param name="column">The <see cref="Column"/> to include in the Table.</param> public void AddColumn( Column column ) { *************** *** 121,125 **** } ! /// <summary></summary> public int ColumnSpan { --- 149,158 ---- } ! /// <summary> ! /// Gets the number of columns that this Table contains. ! /// </summary> ! /// <value> ! /// The number of columns that this Table contains. ! /// </value> public int ColumnSpan { *************** *** 127,131 **** } ! /// <summary></summary> public ICollection ColumnCollection { --- 160,171 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Column"/> objects that ! /// are part of the Table. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Column"/> objects that are ! /// part of the Table. ! /// </value> public ICollection ColumnCollection { *************** *** 133,137 **** } ! /// <summary></summary> public ICollection IndexCollection { --- 173,184 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="Index"/> objects that ! /// are part of the Table. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="Index"/> objects that are ! /// part of the Table. ! /// </value> public ICollection IndexCollection { *************** *** 139,143 **** } ! /// <summary></summary> public ICollection ForeignKeyCollection { --- 186,197 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="ForeignKey"/> objects that ! /// are part of the Table. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="ForeignKey"/> objects that are ! /// part of the Table. ! /// </value> public ICollection ForeignKeyCollection { *************** *** 145,149 **** } ! /// <summary></summary> public ICollection UniqueKeyCollection { --- 199,210 ---- } ! /// <summary> ! /// Gets an <see cref="ICollection"/> of <see cref="UniqueKey"/> objects that ! /// are part of the Table. ! /// </summary> ! /// <value> ! /// An <see cref="ICollection"/> of <see cref="UniqueKey"/> objects that are ! /// part of the Table. ! /// </value> public ICollection UniqueKeyCollection { *************** *** 192,200 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> /// <param name="p"></param> ! /// <returns></returns> public string SqlCreateString( Dialect.Dialect dialect, IMapping p ) { --- 253,264 ---- /// <summary> ! /// Generates the SQL string to create this Table in the database. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> /// <param name="p"></param> ! /// <returns> ! /// A string that contains the SQL to create this Table, Primary Key Constraints ! /// , and Unique Key Constraints. ! /// </returns> public string SqlCreateString( Dialect.Dialect dialect, IMapping p ) { *************** *** 205,209 **** bool identityColumn = idValue != null && idValue.CreateIdentifierGenerator( dialect ) is IdentityGenerator; ! // try to find out the name of the pk to create it as identity if the identitygenerator is used string pkname = null; if( primaryKey != null && identityColumn ) --- 269,274 ---- bool identityColumn = idValue != null && idValue.CreateIdentifierGenerator( dialect ) is IdentityGenerator; ! // try to find out the name of the pk to create it as identity if the ! // identitygenerator is used string pkname = null; if( primaryKey != null && identityColumn ) *************** *** 279,286 **** /// <summary> ! /// /// </summary> ! /// <param name="dialect"></param> ! /// <returns></returns> public string SqlDropString( Dialect.Dialect dialect ) { --- 344,354 ---- /// <summary> ! /// Generates the SQL string to drop this Table in the database. /// </summary> ! /// <param name="dialect">The <see cref="Dialect.Dialect"/> to use for SQL rules.</param> ! /// <returns> ! /// A string that contains the SQL to drop this Table and to cascade the drop to ! /// the constraints if the database supports it. ! /// </returns> public string SqlDropString( Dialect.Dialect dialect ) { *************** *** 288,292 **** } ! /// <summary></summary> public PrimaryKey PrimaryKey { --- 356,363 ---- } ! /// <summary> ! /// Gets or sets the <see cref="PrimaryKey"/> of the Table. ! /// </summary> ! /// <value>The <see cref="PrimaryKey"/> of the Table.</value> public PrimaryKey PrimaryKey { *************** *** 296,303 **** /// <summary> ! /// /// </summary> ! /// <param name="name"></param> ! /// <returns></returns> public Index GetIndex( string name ) { --- 367,377 ---- /// <summary> ! /// Gets the <see cref="Index"/> identified by the name. /// </summary> ! /// <param name="name">The name of the <see cref="Index"/> to get.</param> ! /// <returns> ! /// The <see cref="Index"/> identified by the name. If the <see cref="Index"/> ! /// identified by the name does not exist then it is created. ! /// </returns> public Index GetIndex( string name ) { *************** *** 316,323 **** /// <summary> ! /// /// </summary> ! /// <param name="name"></param> ! /// <returns></returns> public UniqueKey GetUniqueKey( string name ) { --- 390,400 ---- /// <summary> ! /// Gets the <see cref="UniqueKey"/> identified by the name. /// </summary> ! /// <param name="name">The name of the <see cref="UniqueKey"/> to get.</param> ! /// <returns> ! /// The <see cref="UniqueKey"/> identified by the name. If the <see cref="UniqueKey"/> ! /// identified by the name does not exist then it is created. ! /// </returns> public UniqueKey GetUniqueKey( string name ) { *************** *** 336,343 **** /// <summary> ! /// /// </summary> ! /// <param name="columns"></param> ! /// <returns></returns> public ForeignKey CreateForeignKey( IList columns ) { --- 413,427 ---- /// <summary> ! /// Create a <see cref="ForeignKey"/> for the columns in the Table. /// </summary> ! /// <param name="columns">An <see cref="IList"/> of <see cref="Column"/> objects.</param> ! /// <returns> ! /// A <see cref="ForeignKey"/> for the columns in the Table. ! /// </returns> ! /// <remarks> ! /// This does not necessarily create a <see cref="ForeignKey"/>, if ! /// one already exists for the columns then it will return an ! /// existing <see cref="ForeignKey"/>. ! /// </remarks> public ForeignKey CreateForeignKey( IList columns ) { *************** *** 362,369 **** /// <summary> ! /// /// </summary> ! /// <param name="col"></param> ! /// <returns></returns> public string UniqueColumnString( ICollection col ) { --- 446,456 ---- /// <summary> ! /// Generates a unique string for an <see cref="ICollection"/> of ! /// <see cref="Column"/> objects. /// </summary> ! /// <param name="col">An <see cref="ICollection"/> of <see cref="Column"/> objects.</param> ! /// <returns> ! /// An unique string for the <see cref="Column"/> objects. ! /// </returns> public string UniqueColumnString( ICollection col ) { *************** *** 381,389 **** } } ! return ( name.GetHashCode().ToString( "X" ) + result.GetHashCode().ToString( "X" ) ); } ! /// <summary></summary> public string Schema { --- 468,481 ---- } } ! // "X"= hexadecimal format return ( name.GetHashCode().ToString( "X" ) + result.GetHashCode().ToString( "X" ) ); } ! /// <summary> ! /// Gets or sets the schema the table is in. ! /// </summary> ! /// <value> ! /// The schema the table is in or <c>null</c> if no schema is specified. ! /// </value> public string Schema { *************** *** 392,396 **** } ! /// <summary></summary> public int UniqueInteger { --- 484,491 ---- } ! /// <summary> ! /// Gets the unique number of the Table. ! /// </summary> ! /// <value>The unique number of the Table.</value> public int UniqueInteger { *************** *** 399,405 **** /// <summary> ! /// /// </summary> ! /// <param name="idValue"></param> public void SetIdentifierValue( Value idValue ) { --- 494,500 ---- /// <summary> ! /// Sets the Identifier of the Table. /// </summary> ! /// <param name="idValue">The <see cref="Value"/> that represents the Identifier.</param> public void SetIdentifierValue( Value idValue ) { *************** *** 407,411 **** } ! /// <summary></summary> public bool IsQuoted { --- 502,509 ---- } ! /// <summary> ! /// Gets or sets if the column needs to be quoted in SQL statements. ! /// </summary> ! /// <value><c>true</c> if the column is quoted.</value> public bool IsQuoted { Index: Formula.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Mapping/Formula.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Formula.cs 31 Dec 2004 21:26:49 -0000 1.4 --- Formula.cs 2 Jan 2005 22:03:39 -0000 1.5 *************** *** 25,29 **** /// <param name="dialect"></param> /// <returns></returns> ! public String GetTemplate( Dialect.Dialect dialect ) { return Template.RenderWhereStringTemplate( formula, dialect ); --- 25,29 ---- /// <param name="dialect"></param> /// <returns></returns> ! public string GetTemplate( Dialect.Dialect dialect ) { return Template.RenderWhereStringTemplate( formula, dialect ); *************** *** 31,35 **** /// <summary></summary> ! public String Alias { get { return "f" + uniqueInteger.ToString() + StringHelper.Underscore; } --- 31,35 ---- /// <summary></summary> ! public string Alias { get { return "f" + uniqueInteger.ToString() + StringHelper.Underscore; } |
From: Michael D. <mik...@us...> - 2005-01-02 18:04:37
|
Update of /cvsroot/nhibernate/nhibernate/doc/reference/en/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24832 Modified Files: configuration.xml Log Message: More documentation about the various configuration settings. Index: configuration.xml =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/doc/reference/en/modules/configuration.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configuration.xml 30 Dec 2004 16:38:51 -0000 1.2 --- configuration.xml 2 Jan 2005 18:04:21 -0000 1.3 *************** *** 197,207 **** <tbody> <row> <entry> <literal>hibernate.connection.driver_class</literal> </entry> <entry> ! Implementation of <literal>NHibernate.Driver.IDriver</literal> interface ! that NHibernate will use to get the implementation of IDbConnection ! , IDbCommand, and IDbDataParameter. </entry> </row> --- 197,225 ---- <tbody> <row> + <entry> + <literal>hibernate.connection.provider_class</literal> + </entry> + <entry> + The type of a custom <literal>IConnectionProvider</literal>. + <para> + <emphasis role="strong">eg.</emphasis> + <literal>full.classname.of.ConnectionProvider</literal> if the Provider + is built into NHibernate, or <literal>full.classname.of.ConnectionProvider, + assembly</literal> if using an implementation of IConnectionProvider not + included in NHibernate. + </para> + </entry> + </row> + <row> <entry> <literal>hibernate.connection.driver_class</literal> </entry> <entry> ! The type of a custom <literal>IDriver</literal>. ! <para> ! <literal>full.classname.of.Driver</literal> if the Driver ! is built into NHibernate, or <literal>full.classname.of.Driver, assembly</literal> ! if using an implementation of IDriver not included in NHibernate. ! </para> </entry> </row> *************** *** 214,218 **** </entry> </row> ! </tbody> </tgroup> </table> --- 232,250 ---- </entry> </row> ! <row> ! <entry> ! <literal>hibernate.connection.isolation</literal> ! </entry> ! <entry> ! Set the ADO.NET transaction isolation level. Check ! <literal>System.Data.IsolationLevel</literal> for meaningful values ! and the database's documentation to ensure that level is supported. ! <para> ! <emphasis role="strong">eg.</emphasis> ! <literal>Chaos, ReadCommitted, ReadUncommitted, RepeatableRead, Serializable, Unspecified </literal> ! </para> ! </entry> ! </row> ! </tbody> </tgroup> </table> *************** *** 254,268 **** </nhibernate> ! <!-- log4net and other app specific config follows --> </configuration> ]]></programlisting> - - <para> - You may define your own plugin strategy for obtaining ADO.NET connections by implementing the - interface <literal>NHibernate.Connection.IConnectionProvider</literal>. You may select - a custom implementation by setting <literal>hibernate.connection.provider_class</literal>. - </para> - </sect1> --- 286,293 ---- </nhibernate> ! <!-- log4net (required by NHibernate) and other app specific config follows --> </configuration> ]]></programlisting> </sect1> *************** *** 296,300 **** <para> <emphasis role="strong">eg.</emphasis> ! <literal>full.classname.of.Dialect</literal> </para> </entry> --- 321,327 ---- <para> <emphasis role="strong">eg.</emphasis> ! <literal>full.classname.of.Dialect</literal> if a Dialect built into ! NHibernate, or <literal>full.classname.of.Dialect, assembly</literal> ! if using an implementation of Dialect not included in NHibernate. </para> </entry> *************** *** 315,326 **** <row> <entry> ! <literal>hibernate.session_factory_name</literal> </entry> <entry> ! The <literal>SessionFactory</literal> will be automatically ! bound to this name after it has been created. <para> <emphasis role="strong">eg.</emphasis> ! <literal>some.name</literal> </para> </entry> --- 342,352 ---- <row> <entry> ! <literal>hibernate.prepare_sql</literal> </entry> <entry> ! Enables preparing of sql statements. <para> <emphasis role="strong">eg.</emphasis> ! <literal>true</literal> | <literal>false</literal> </para> </entry> *************** *** 328,364 **** <row> <entry> ! <literal>hibernate.use_outer_join</literal> </entry> <entry> ! Enables outer join fetching. <para> <emphasis role="strong">eg.</emphasis> ! <literal>true</literal> | <literal>false</literal> </para> </entry> </row> <row> - <entry> - <literal>hibernate.connection.isolation</literal> - </entry> - <entry> - Set the ADO.NET transaction isolation level. Check - <literal>System.Data.IsolationLevel</literal> for meaningful values but - note that most databases do not support all isolation levels. - <para> - <emphasis role="strong">eg.</emphasis> - <literal>Chaos, ReadCommitted, ReadUncommitted, RepeatableRead, Serializable, Unspecified </literal> - </para> - </entry> - </row> - <row> <entry> ! <literal>hibernate.connection.provider_class</literal> </entry> <entry> ! The type of a custom <literal>ConnectionProvider</literal>. <para> <emphasis role="strong">eg.</emphasis> ! <literal>typename.of.ConnectionProvider</literal> </para> </entry> --- 354,377 ---- <row> <entry> ! <literal>hibernate.session_factory_name</literal> </entry> <entry> ! The <literal>SessionFactory</literal> will be automatically ! bound to this name after it has been created. <para> <emphasis role="strong">eg.</emphasis> ! <literal>some.name</literal> </para> </entry> </row> <row> <entry> ! <literal>hibernate.use_outer_join</literal> </entry> <entry> ! Enables outer join fetching. <para> <emphasis role="strong">eg.</emphasis> ! <literal>true</literal> | <literal>false</literal> </para> </entry> *************** *** 372,376 **** <para> <emphasis role="strong">eg.</emphasis> ! <literal>typename.of.CacheProvider</literal> </para> </entry> --- 385,391 ---- <para> <emphasis role="strong">eg.</emphasis> ! <literal>full.classname.of.CacheProvider</literal> if the ICacheProvider is ! built into NHibernate, or <literal>full.classname.of.CacheProvider, assembly</literal> ! if using an implementation of ICacheProvider not included in NHibernate. </para> </entry> *************** *** 405,411 **** </table> ! <!-- resume at <sect2 id="configuration-optional-dialects"> --> </sect1> </chapter> \ No newline at end of file --- 420,587 ---- </table> ! <sect2 id="configuration-optional-dialects"> ! <title>SQL Dialects</title> ! ! <para> ! You should always set the <literal>hibernate.dialect</literal> property to the correct ! <literal>NHibernate.Dialect.Dialect</literal> subclass for your database. This is not ! strictly essential unless you wish to use <literal>native</literal> or ! <literal>sequence</literal> primary key generation or pessimistic locking (with, eg. ! <literal>ISession.Lock()</literal> or <literal>IQuery.SetLockMode()</literal>). ! However, if you specify a dialect, NHibernate will use sensible defaults for some of the ! other properties listed above, saving you the effort of specifying them manually. ! </para> ! ! <table frame="topbot" id="sql-dialects" revision="2"> ! <title>NHibernate SQL Dialects (<literal>hibernate.dialect</literal>)</title> ! <tgroup cols="2"> ! <colspec colwidth="1*"/> ! <colspec colwidth="2.5*"/> ! <thead> ! <row> ! <entry>RDBMS</entry> ! <entry>Dialect</entry> ! </row> ! </thead> ! <tbody> ! <row> ! <entry>DB2</entry> ! <entry><literal>NHibernate.Dialect.DB2Dialect</literal></entry> ! </row> ! <row> ! <entry>PostgreSQL</entry> ! <entry><literal>NHibernate.Dialect.PostgreSQLDialect</literal></entry> ! </row> ! <row> ! <entry>MySQL</entry> ! <entry><literal>NHibernate.Dialect.MySQLDialect</literal></entry> ! </row> ! <row> ! <entry>Oracle (any version)</entry> ! <entry><literal>NHibernate.Dialect.OracleDialect</literal></entry> ! </row> ! <row> ! <entry>Oracle 9/10g</entry> ! <entry><literal>NHibernate.Dialect.Oracle9Dialect</literal></entry> ! </row> ! <row> ! <entry>Sybase</entry> ! <entry><literal>NHibernate.Dialect.SybaseDialect</literal></entry> ! </row> ! <row> ! <entry>Microsoft SQL Server 2000</entry> ! <entry><literal>NHibernate.Dialect.MsSql2000Dialect</literal></entry> ! </row> ! <row> ! <entry>Microsoft SQL Server 7</entry> ! <entry><literal>NHibernate.Dialect.MsSql7Dialect</literal></entry> ! </row> ! <row> ! <entry>Firebird</entry> ! <entry><literal>NHibernate.Dialect.FirebirdDialect</literal></entry> ! </row> ! </tbody> ! </tgroup> ! </table> ! ! </sect2> ! ! <sect2 id="configuration-optional-outerjoin"> ! <title>Outer Join Fetching</title> ! ! <para> ! If your database supports ANSI or Oracle style outer joins, <emphasis>outer join ! fetching</emphasis> might increase performance by limiting the number of round ! trips to and from the database (at the cost of possibly more work performed by ! the database itself). Outer join fetching allows a graph of objects connected ! by many-to-one, one-to-many or one-to-one associations to be retrieved in a single ! SQL <literal>SELECT</literal>. ! </para> ! ! <para> ! By default, the fetched graph when loading an objects ends at leaf objects, ! collections, objects with proxies, or where circularities occur. ! </para> ! ! <para> ! For a <emphasis>particular association</emphasis>, fetching may be enabled ! or disabled (and the default behaviour overridden) by setting the ! <literal>outer-join</literal> attribute in the XML mapping. ! </para> ! ! <para> ! Outer join fetching may be disabled <emphasis>globally</emphasis> by setting ! the property <literal>hibernate.use_outer_join </literal> to <literal>false</literal>. ! A setting of <literal>true</literal> enables outer join fetching for ! all one-to-one and many-to-one associations, which are, also by default, set ! to <literal>auto</literal> outer join. However, one-to-many associations and ! collections are never fetched with an outer-join, unless explicitly declared ! for each particular association. This behavior can also be overriden at runtime ! with Hibernate queries. ! </para> ! ! </sect2> ! ! <sect2 id="configuration-optional-cacheprovider"> ! <title>Custom <literal>CacheProvider</literal></title> ! ! <para> ! You may integrate a second-level cache system by ! implementing the interface <literal>NHibernate.Cache.ICacheProvider</literal>. ! You may select the custom implementation by setting ! <literal>hibernate.cache.provider_class</literal>. ! </para> ! ! </sect2> ! ! <sect2 id="configuration-optional-querysubstitution"> ! <title>Query Language Substitution</title> ! ! <para> ! You may define new Hibernate query tokens using <literal>hibernate.query.substitutions</literal>. ! For example: ! </para> ! ! <programlisting>hibernate.query.substitutions true=1, false=0</programlisting> ! ! <para> ! would cause the tokens <literal>true</literal> and <literal>false</literal> to be translated to ! integer literals in the generated SQL. ! </para> ! ! <programlisting>hibernate.query.substitutions toLowercase=LOWER</programlisting> ! ! <para> ! would allow you to rename the SQL <literal>LOWER</literal> function. ! </para> ! ! </sect2> ! </sect1> + + <sect1 id="configuration-logging"> + <title>Logging</title> + + <para> + NHibernate logs various events using Apache log4net. + </para> + <para> + You may download log4net from <literal>http://logging.apache.org/log4net/</literal>. + To use log4net you will need a log4net configuration section in the app.config + or web.config. An example of the configuration section is distributed with + NHibernate in the <literal>src/NHibernate.Test</literal> project. + </para> + + <para> + We strongly recommend that you familiarize yourself with NHibernate's log + messages. A lot of work has been put into making the NHibernate log as + detailed as possible, without making it unreadable. It is an essential + troubleshooting device. + </para> + + </sect1> + + <!-- resume at <sect1 id="configuration-xmlconfig"> --> </chapter> \ No newline at end of file |
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate.Test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22838 Modified Files: ABCProxyTest.cs ABCTest.cs CriteriaTest.cs FumTest.cs ParentChildTest.cs SimpleTest.cs SQLFunctionsTest.cs Log Message: Modified fixtures so they don't recreate the tables for each [Test] Index: CriteriaTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/CriteriaTest.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CriteriaTest.cs 17 Nov 2004 01:02:14 -0000 1.7 --- CriteriaTest.cs 1 Jan 2005 20:39:38 -0000 1.8 *************** *** 1,5 **** using System; using System.Collections; - using System.Data; using NHibernate.DomainModel; --- 1,4 ---- *************** *** 12,21 **** public class CriteriaTest : TestCase { [SetUp] public void SetUp() { ! ExportSchema( new string[] { "Simple.hbm.xml"}); } [Test] public void SimpleSelectTest() --- 11,45 ---- public class CriteriaTest : TestCase { + + #region NUnit.Framework.TestFixture Members + + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + ExportSchema( new string[] { "Simple.hbm.xml"}); + } + [SetUp] public void SetUp() { ! // there are test in here where we don't need to resetup the ! // tables - so only set the tables up once ! } ! ! [TearDown] ! public override void TearDown() ! { ! // do nothing except not let the base TearDown get called ! } ! ! [TestFixtureTearDown] ! public void TestFixtureTearDown() ! { ! base.TearDown(); } + #endregion + + [Test] public void SimpleSelectTest() Index: SimpleTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SimpleTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SimpleTest.cs 20 Sep 2004 17:45:58 -0000 1.6 --- SimpleTest.cs 1 Jan 2005 20:39:38 -0000 1.7 *************** *** 10,24 **** public class SimpleTest : TestCase { - private DateTime testDateTime = new DateTime(2003, 8, 16); private DateTime updateDateTime = new DateTime(2003, 8, 17); [SetUp] public void SetUp() { ! ExportSchema( new string[] { "Simple.hbm.xml"} ); } [Test] public void TestCRUD() --- 10,45 ---- public class SimpleTest : TestCase { private DateTime testDateTime = new DateTime(2003, 8, 16); private DateTime updateDateTime = new DateTime(2003, 8, 17); + #region NUnit.Framework.TestFixture Members + + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + ExportSchema( new string[] { "Simple.hbm.xml"} ); + } [SetUp] public void SetUp() { ! // there are test in here where we don't need to resetup the ! // tables - so only set the tables up once } + [TearDown] + public override void TearDown() + { + // do nothing except not let the base TearDown get called + } + + [TestFixtureTearDown] + public void TestFixtureTearDown() + { + base.TearDown(); + } + + #endregion + [Test] public void TestCRUD() Index: SQLFunctionsTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/SQLFunctionsTest.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SQLFunctionsTest.cs 30 Oct 2004 14:41:54 -0000 1.6 --- SQLFunctionsTest.cs 1 Jan 2005 20:39:38 -0000 1.7 *************** *** 14,25 **** public class SQLFunctionsTest : TestCase { ! [SetUp] ! public void SetUp() { ExportSchema( new string[] { "Simple.hbm.xml", ! "Blobber.hbm.xml" } ); } [Test] public void SetProperties() --- 14,48 ---- public class SQLFunctionsTest : TestCase { ! #region NUnit.Framework.TestFixture Members ! ! [TestFixtureSetUp] ! public void TestFixtureSetUp() { ExportSchema( new string[] { "Simple.hbm.xml", ! "Blobber.hbm.xml" } ); } + [SetUp] + public void SetUp() + { + // there are test in here where we don't need to resetup the + // tables - so only set the tables up once + } + + [TearDown] + public override void TearDown() + { + // do nothing except not let the base TearDown get called + } + + [TestFixtureTearDown] + public void TestFixtureTearDown() + { + base.TearDown(); + } + + #endregion + [Test] public void SetProperties() Index: FumTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/FumTest.cs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** FumTest.cs 18 Nov 2004 02:46:59 -0000 1.16 --- FumTest.cs 1 Jan 2005 20:39:38 -0000 1.17 *************** *** 17,46 **** protected static short fumKeyShort = 1; [SetUp] ! public void SetUp() { ! ExportSchema(new string[] { ! "FooBar.hbm.xml", ! "Baz.hbm.xml", ! "Qux.hbm.xml", ! "Glarch.hbm.xml", ! "Fum.hbm.xml", ! "Fumm.hbm.xml", ! "Fo.hbm.xml", ! "One.hbm.xml", ! "Many.hbm.xml", ! "Immutable.hbm.xml", ! "Fee.hbm.xml", ! "Vetoer.hbm.xml", ! "Holder.hbm.xml", ! "Location.hbm.xml", ! "Stuff.hbm.xml", ! "Container.hbm.xml", ! "Simple.hbm.xml", ! "Middle.hbm.xml" ! }, true); } public static FumCompositeID FumKey(String str) { --- 17,68 ---- protected static short fumKeyShort = 1; + #region NUnit.Framework.TestFixture Members + + [TestFixtureSetUp] + public void TestFixtureSetUp() + { + ExportSchema(new string[] { + "FooBar.hbm.xml", + "Baz.hbm.xml", + "Qux.hbm.xml", + "Glarch.hbm.xml", + "Fum.hbm.xml", + "Fumm.hbm.xml", + "Fo.hbm.xml", + "One.hbm.xml", + "Many.hbm.xml", + "Immutable.hbm.xml", + "Fee.hbm.xml", + "Vetoer.hbm.xml", + "Holder.hbm.xml", + "Location.hbm.xml", + "Stuff.hbm.xml", + "Container.hbm.xml", + "Simple.hbm.xml", + "Middle.hbm.xml" + }, true); + } + [SetUp] ! public void SetUp() ! { ! // there are test in here where we don't need to resetup the ! // tables - so only set the tables up once ! } ! ! [TearDown] ! public override void TearDown() { + // do nothing except not let the base TearDown get called + } ! [TestFixtureTearDown] ! public void TestFixtureTearDown() ! { ! base.TearDown(); } + #endregion + public static FumCompositeID FumKey(String str) { Index: ParentChildTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ParentChildTest.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ParentChildTest.cs 18 Nov 2004 02:46:59 -0000 1.10 --- ParentChildTest.cs 1 Jan 2005 20:39:38 -0000 1.11 *************** *** 14,19 **** public class ParentChildTest : TestCase { ! [SetUp] ! public void SetUp() { ExportSchema( new string[] { "FooBar.hbm.xml", --- 14,22 ---- public class ParentChildTest : TestCase { ! ! #region NUnit.Framework.TestFixture Members ! ! [TestFixtureSetUp] ! public void TestFixtureSetUp() { ExportSchema( new string[] { "FooBar.hbm.xml", *************** *** 38,41 **** --- 41,65 ---- } + [SetUp] + public void SetUp() + { + // there are test in here where we don't need to resetup the + // tables - so only set the tables up once + } + + [TearDown] + public override void TearDown() + { + // do nothing except not let the base TearDown get called + } + + [TestFixtureTearDown] + public void TestFixtureTearDown() + { + base.TearDown(); + } + + #endregion + [Test] public void CollectionQuery() Index: ABCProxyTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCProxyTest.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ABCProxyTest.cs 16 Dec 2004 21:56:05 -0000 1.10 --- ABCProxyTest.cs 1 Jan 2005 20:39:37 -0000 1.11 *************** *** 12,21 **** public class ABCProxyTest : TestCase { ! [SetUp] ! public void SetUp() { ExportSchema(new string[] { "ABCProxy.hbm.xml"}); } [Test] //[Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] --- 12,45 ---- public class ABCProxyTest : TestCase { ! ! #region NUnit.Framework.TestFixture Members ! ! [TestFixtureSetUp] ! public void TestFixtureSetUp() { ExportSchema(new string[] { "ABCProxy.hbm.xml"}); } + [SetUp] + public void SetUp() + { + // there are test in here where we don't need to resetup the + // tables - so only set the tables up once + } + + [TearDown] + public override void TearDown() + { + // do nothing except not let the base TearDown get called + } + + [TestFixtureTearDown] + public void TestFixtureTearDown() + { + base.TearDown(); + } + + #endregion + [Test] //[Ignore("Proxies Required - http://jira.nhibernate.org:8080/browse/NH-41")] Index: ABCTest.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate.Test/ABCTest.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ABCTest.cs 12 Jul 2004 21:17:06 -0000 1.9 --- ABCTest.cs 1 Jan 2005 20:39:38 -0000 1.10 *************** *** 15,24 **** public class ABCTest : TestCase { ! [SetUp] ! public void SetUp() { ExportSchema(new string[] { "ABC.hbm.xml"}); } [Test] public void Subclassing() --- 15,49 ---- public class ABCTest : TestCase { ! ! #region NUnit.Framework.TestFixture Members ! ! [TestFixtureSetUp] ! public void TestFixtureSetUp() { ExportSchema(new string[] { "ABC.hbm.xml"}); } + [SetUp] + public void SetUp() + { + // there are test in here where we don't need to resetup the + // tables - so only set the tables up once + } + + [TearDown] + public override void TearDown() + { + // do nothing except not let the base TearDown get called + } + + [TestFixtureTearDown] + public void TestFixtureTearDown() + { + base.TearDown(); + } + + #endregion + + [Test] public void Subclassing() |
From: Kevin W. <kev...@us...> - 2005-01-01 14:21:16
|
Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11266 Modified Files: DriverBase.cs Log Message: fix exception when named parameter is not assigned (NH-177) Index: DriverBase.cs =================================================================== RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Driver/DriverBase.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DriverBase.cs 31 Dec 2004 17:25:35 -0000 1.10 --- DriverBase.cs 1 Jan 2005 14:21:04 -0000 1.11 *************** *** 189,192 **** --- 189,196 ---- protected virtual IDbDataParameter GenerateParameter( IDbCommand command, string name, Parameter parameter, Dialect.Dialect dialect ) { + if( name != null && parameter != null && parameter.SqlType == null ) + { + throw new QueryException( String.Format( "No value assigned to parameter '{0}': be sure to set values for named parameters.", name ) ); + } IDbDataParameter dbParam = command.CreateParameter(); dbParam.DbType = parameter.SqlType.DbType; |