springnet-commits Mailing List for Spring Framework .NET (Page 43)
Brought to you by:
aseovic,
markpollack
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(33) |
Aug
(163) |
Sep
(491) |
Oct
(289) |
Nov
(336) |
Dec
(84) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(227) |
Feb
(413) |
Mar
(128) |
Apr
(232) |
May
(92) |
Jun
(299) |
Jul
(386) |
Aug
(228) |
Sep
(237) |
Oct
(426) |
Nov
(325) |
Dec
(405) |
2006 |
Jan
(315) |
Feb
(311) |
Mar
(152) |
Apr
(177) |
May
(443) |
Jun
(92) |
Jul
(88) |
Aug
(80) |
Sep
(288) |
Oct
(515) |
Nov
(1049) |
Dec
(440) |
2007 |
Jan
(179) |
Feb
(406) |
Mar
(294) |
Apr
(80) |
May
(432) |
Jun
(242) |
Jul
(452) |
Aug
(710) |
Sep
(206) |
Oct
(240) |
Nov
(65) |
Dec
(227) |
2008 |
Jan
(80) |
Feb
(90) |
Mar
(98) |
Apr
(136) |
May
(101) |
Jun
(12) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Erich E. <oak...@us...> - 2007-09-29 21:32:14
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7755 Modified Files: CustomerEditor.aspx.cs CustomerList.aspx.cs Dao.xml Web.config Web.xml Added Files: CustomerOrders.aspx CustomerOrders.aspx.cs Log Message: extended northwind sample with handling lazy-loading for session-stored nhibernate proxies Index: Dao.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/Dao.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Dao.xml 7 Aug 2007 19:49:57 -0000 1.2 --- Dao.xml 29 Sep 2007 21:32:08 -0000 1.3 *************** *** 25,29 **** --> ! <object id="SessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate"> <property name="DbProvider" ref="DbProvider"/> <property name="MappingAssemblies"> --- 25,29 ---- --> ! <object id="NHibernateSessionFactory" type="Spring.Data.NHibernate.LocalSessionFactoryObject, Spring.Data.NHibernate"> <property name="DbProvider" ref="DbProvider"/> <property name="MappingAssemblies"> *************** *** 54,63 **** <property name="DbProvider" ref="DbProvider"/> ! <property name="SessionFactory" ref="SessionFactory"/> </object> <object id="HibernateTemplate" type="Spring.Data.NHibernate.HibernateTemplate"> ! <property name="SessionFactory" ref="SessionFactory" /> <property name="TemplateFlushMode" value="Auto" /> <property name="CacheQueries" value="true" /> --- 54,63 ---- <property name="DbProvider" ref="DbProvider"/> ! <property name="SessionFactory" ref="NHibernateSessionFactory"/> </object> <object id="HibernateTemplate" type="Spring.Data.NHibernate.HibernateTemplate"> ! <property name="SessionFactory" ref="NHibernateSessionFactory" /> <property name="TemplateFlushMode" value="Auto" /> <property name="CacheQueries" value="true" /> --- NEW FILE: CustomerOrders.aspx --- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="CustomerOrders.aspx.cs" Inherits="CustomerOrders" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:DataGrid id="customerOrders" runat="server" AllowPaging="false" AllowSorting="false" BorderColor="black" BorderWidth="1" CellPadding="3" AutoGenerateColumns="false" ShowFooter="true" > <Columns> <asp:BoundColumn HeaderText="OrderID" DataField="ID" /> <asp:BoundColumn HeaderText="OrderDate" DataField="OrderDate" /> <asp:BoundColumn HeaderText="ShippedDate" DataField="ShippedDate"/> </Columns> </asp:DataGrid> </div> </form> </body> </html> --- NEW FILE: CustomerOrders.aspx.cs --- using System; using System.Collections; using System.Web.UI.WebControls; using Spring.Northwind.Domain; public partial class CustomerOrders:Spring.Web.UI.Page { private ICustomerEditController customerEditController; public ICustomerEditController CustomerEditController { set { this.customerEditController = value; } } public Customer SelectedCustomer { get { return this.customerEditController.CurrentCustomer; } } public CustomerOrders() { this.InitializeControls+=new EventHandler(Page_InitializeControls); this.DataBound+=new EventHandler(Page_DataBound); this.DataUnbound+=new EventHandler(Page_DataUnbound); } override protected void InitializeDataBindings() { base.InitializeDataBindings(); // do the "one time" setup for databinding } private void Page_DataBound(object sender, EventArgs e) { // perform custom tasks for binding data from model to the form } private void Page_DataUnbound(object sender, EventArgs e) { // perform custom tasks for unbinding data from form to the model } private void Page_InitializeControls(object sender, EventArgs e) { // create/initialize controls here customerOrders.DataSource = SelectedCustomer.Orders; if (!IsPostBack) { customerOrders.DataBind(); } else { customerOrders.ItemCreated+=new DataGridItemEventHandler( this.CustomerList_ItemCreated ); } } private void CustomerList_ItemCreated(object sender, DataGridItemEventArgs e) { if(e.Item.DataSetIndex > -1) { e.Item.DataItem = ((IList)customerOrders.DataSource)[e.Item.DataSetIndex]; } } } Index: Web.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/Web.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Web.xml 1 Jun 2007 02:54:44 -0000 1.1 --- Web.xml 29 Sep 2007 21:32:09 -0000 1.2 *************** *** 2,28 **** <objects xmlns="http://www.springframework.net"> ! <!-- Referenced by main application context configuration file --> ! <description> ! The Northwind web layer definitions ! </description> ! <object type="Default.aspx"> ! <property name="FulfillmentService" ref="FulfillmentService" /> <property name="CustomerDao" ref="CustomerDao" /> ! </object> ! <object type="CustomerList.aspx"> ! <property name="CustomerDao" ref="CustomerDao" /> ! <property name="Results"> ! <dictionary> ! <entry key="EditCustomer" value="redirect:CustomerEditor.aspx" /> ! </dictionary> ! </property> ! </object> ! <object type="CustomerEditor.aspx"> ! <property name="CustomerDao" ref="CustomerDao" /> ! </object> </objects> --- 2,39 ---- <objects xmlns="http://www.springframework.net"> ! <!-- Referenced by main application context configuration file --> ! <description> ! The Northwind web layer definitions ! </description> ! <object name="CustomerEditController" type="NHibernateCustomerEditController" scope="session"> ! <constructor-arg name="sessionFactory" ref="NHibernateSessionFactory"/> ! </object> ! ! <object type="Default.aspx"> ! <property name="FulfillmentService" ref="FulfillmentService" /> <property name="CustomerDao" ref="CustomerDao" /> ! </object> ! <object name="CustomerEditPage" abstract="true"> ! <property name="CustomerEditController" ref="CustomerEditController" /> ! </object> ! ! <object type="CustomerList.aspx" parent="CustomerEditPage"> ! <property name="CustomerDao" ref="CustomerDao" /> ! <property name="Results"> ! <dictionary> ! <entry key="EditCustomer" value="redirect:CustomerEditor.aspx" /> ! <entry key="ViewOrders" value="redirect:CustomerOrders.aspx" /> ! </dictionary> ! </property> ! </object> ! <object type="CustomerEditor.aspx" parent="CustomerEditPage"> ! <property name="CustomerDao" ref="CustomerDao" /> ! </object> ! ! <object type="CustomerOrders.aspx" parent="CustomerEditPage" /> </objects> Index: CustomerList.aspx.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/CustomerList.aspx.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CustomerList.aspx.cs 20 Jul 2007 16:53:33 -0000 1.2 --- CustomerList.aspx.cs 29 Sep 2007 21:32:08 -0000 1.3 *************** *** 7,10 **** --- 7,11 ---- public partial class CustomerList : Spring.Web.UI.Page { + private ICustomerEditController customerEditController; private ICustomerDao customerDao; *************** *** 14,17 **** --- 15,23 ---- } + public ICustomerEditController CustomerEditController + { + set { this.customerEditController = value; } + } + public Customer SelectedCustomer { *************** *** 75,79 **** case "EditCustomer": customerList.SelectedIndex = e.Item.ItemIndex; ! CustomerEditor.Edit(this.SelectedCustomer); SetResult(e.CommandName); break; --- 81,85 ---- case "EditCustomer": customerList.SelectedIndex = e.Item.ItemIndex; ! customerEditController.EditCustomer(this.SelectedCustomer); SetResult(e.CommandName); break; Index: CustomerEditor.aspx.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/CustomerEditor.aspx.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CustomerEditor.aspx.cs 1 Jun 2007 02:54:44 -0000 1.1 --- CustomerEditor.aspx.cs 29 Sep 2007 21:32:08 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- public partial class CustomerEditor : Page { + private ICustomerEditController customerEditController; private ICustomerDao customerDao; *************** *** 14,29 **** } public Customer CurrentCustomer { get { ! return (Customer) Session[typeof(CustomerEditor).FullName + ".Customer"]; } } ! public static void Edit( Customer customer ) ! { ! HttpContext.Current.Session[typeof(CustomerEditor).FullName + ".Customer"] = customer; ! } public CustomerEditor() --- 15,36 ---- } + public ICustomerEditController CustomerEditController + { + set { this.customerEditController = value; } + } + public Customer CurrentCustomer { get { ! //return (Customer) Session[typeof(CustomerEditor).FullName + ".Customer"]; ! return customerEditController.CurrentCustomer; } } ! // public static void Edit( Customer customer ) ! // { ! // HttpContext.Current.Session[typeof(CustomerEditor).FullName + ".Customer"] = customer; ! // } public CustomerEditor() Index: Web.config =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/Web.config,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Web.config 8 Aug 2007 03:13:29 -0000 1.5 --- Web.config 29 Sep 2007 21:32:08 -0000 1.6 *************** *** 49,53 **** </databaseSettings> <appSettings> ! <add key="Spring.Data.NHibernate.Support.OpenSessionInViewModule.SessionFactoryObjectName" value="SessionFactory"/> </appSettings> <connectionStrings/> --- 49,53 ---- </databaseSettings> <appSettings> ! <add key="Spring.Data.NHibernate.Support.OpenSessionInViewModule.SessionFactoryObjectName" value="NHibernateSessionFactory"/> </appSettings> <connectionStrings/> |
From: Erich E. <oak...@us...> - 2007-09-29 21:32:12
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/App_Code In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7755/App_Code Added Files: ICustomerEditController.cs NHibernateCustomerEditController.cs Log Message: extended northwind sample with handling lazy-loading for session-stored nhibernate proxies --- NEW FILE: ICustomerEditController.cs --- using Spring.Northwind.Domain; public interface ICustomerEditController { void EditCustomer(Customer customer); void Clear(); Customer CurrentCustomer { get; } } --- NEW FILE: NHibernateCustomerEditController.cs --- using System.Web; using NHibernate; using Spring.Data.NHibernate; using Spring.Northwind.Domain; /// <summary> /// </summary> /// <author>erich.eichinger</author> /// <version>$Id: NHibernateCustomerEditController.cs,v 1.1 2007/09/29 21:32:09 oakinger Exp $</version> public class NHibernateCustomerEditController:ICustomerEditController { private readonly ISessionFactory sessionFactory; private Customer currentCustomer; public NHibernateCustomerEditController(ISessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } private ISession Session { get { return SessionFactoryUtils.GetSession( sessionFactory,false ); } } public void EditCustomer(Customer customer) { currentCustomer = customer; } public void Clear() { currentCustomer = null; } public Customer CurrentCustomer { get { Customer customer = currentCustomer; Session.Lock(customer, LockMode.None); return customer; } } } |
From: Erich E. <oak...@us...> - 2007-09-29 21:30:14
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/App_Code In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6801/App_Code Log Message: Directory /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/src/Spring.Northwind.Web/App_Code added to the repository |
From: Erich E. <oak...@us...> - 2007-09-29 21:29:37
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6568 Modified Files: OpenSessionInViewModule.cs Log Message: fixed SPRNET-731 (osiv configuration) Index: OpenSessionInViewModule.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Support/OpenSessionInViewModule.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OpenSessionInViewModule.cs 8 Aug 2007 18:41:12 -0000 1.5 --- OpenSessionInViewModule.cs 29 Sep 2007 21:29:23 -0000 1.6 *************** *** 43,47 **** /// but does not yet associate a session with a thread, that is lef to the lifecycle of the request. /// </summary> ! public OpenSessionInViewModule() : base(false) { --- 43,47 ---- /// but does not yet associate a session with a thread, that is lef to the lifecycle of the request. /// </summary> ! public OpenSessionInViewModule() : base("appSettings", false) { |
From: Erich E. <oak...@us...> - 2007-09-29 17:32:46
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11150/examples/Spring/Spring.Data.NHibernate.Northwind Modified Files: Spring.Northwind.sln Log Message: fixed integration tests in nh-northwind sample Index: Spring.Northwind.sln =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/Spring.Northwind.sln,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Spring.Northwind.sln 17 Jul 2007 15:36:05 -0000 1.3 --- Spring.Northwind.sln 29 Sep 2007 17:31:54 -0000 1.4 *************** *** 69,72 **** --- 69,82 ---- EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|.NET.ActiveCfg = Debug|.NET + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|.NET.Build.0 = Debug|.NET + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|Any CPU.ActiveCfg = Debug|.NET + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|Mixed Platforms.ActiveCfg = Debug|.NET + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|Mixed Platforms.Build.0 = Debug|.NET + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|.NET.ActiveCfg = Debug|.NET + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|.NET.Build.0 = Debug|.NET + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|Any CPU.ActiveCfg = Debug|.NET + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|Mixed Platforms.ActiveCfg = Debug|.NET + {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|Mixed Platforms.Build.0 = Debug|.NET {9E15876F-E9E0-43B7-9874-B54F163757D6}.Debug|.NET.ActiveCfg = Debug|Any CPU {9E15876F-E9E0-43B7-9874-B54F163757D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU *************** *** 119,132 **** {53B04C54-63EA-45AA-BB83-8950AF3C5D68}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {53B04C54-63EA-45AA-BB83-8950AF3C5D68}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|.NET.ActiveCfg = Debug|.NET - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|.NET.Build.0 = Debug|.NET - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|Any CPU.ActiveCfg = Debug|.NET - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|Mixed Platforms.ActiveCfg = Debug|.NET - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Debug|Mixed Platforms.Build.0 = Debug|.NET - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|.NET.ActiveCfg = Debug|.NET - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|.NET.Build.0 = Debug|.NET - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|Any CPU.ActiveCfg = Debug|.NET - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|Mixed Platforms.ActiveCfg = Debug|.NET - {3E321CBC-75B0-45C4-AFEF-7CEED28368AE}.Release|Mixed Platforms.Build.0 = Debug|.NET {FD89FEBE-4914-45F3-9123-B2CB954810DD}.Debug|.NET.ActiveCfg = Debug|Any CPU {FD89FEBE-4914-45F3-9123-B2CB954810DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU --- 129,132 ---- *************** *** 143,145 **** --- 143,148 ---- HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + NAntAddinLastFileName = + EndGlobalSection EndGlobal |
From: Erich E. <oak...@us...> - 2007-09-29 17:32:01
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11150/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests Modified Files: Services.xml Spring.Northwind.IntegrationTests.csproj Log Message: fixed integration tests in nh-northwind sample Index: Services.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests/Services.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Services.xml 14 Sep 2007 20:11:57 -0000 1.1 --- Services.xml 29 Sep 2007 17:31:55 -0000 1.2 *************** *** 19,31 **** </object> - <!-- <import resource="DeclarativeServicesAttributeDriven.xml"/> - --> <!-- didn't configure correctly yet - don't use <import resource="DeclarativeServicesObjectNameDriven.xml"/> --> ! <import resource="DeclarativeServicesTxProxyFactoryDriven.xml"/> ! </objects> --- 19,29 ---- </object> <import resource="DeclarativeServicesAttributeDriven.xml"/> <!-- didn't configure correctly yet - don't use <import resource="DeclarativeServicesObjectNameDriven.xml"/> --> ! <!-- <import resource="DeclarativeServicesTxProxyFactoryDriven.xml"/> ! --> </objects> Index: Spring.Northwind.IntegrationTests.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests/Spring.Northwind.IntegrationTests.csproj,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Spring.Northwind.IntegrationTests.csproj 14 Sep 2007 20:11:56 -0000 1.5 --- Spring.Northwind.IntegrationTests.csproj 29 Sep 2007 17:31:55 -0000 1.6 *************** *** 121,127 **** <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> - <Content Include="Web.xml"> - <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> - </Content> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> --- 121,124 ---- |
From: Erich E. <oak...@us...> - 2007-09-29 17:31:58
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests/IntegrationTests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11150/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests/IntegrationTests Modified Files: FulfillmentServiceTests.cs Log Message: fixed integration tests in nh-northwind sample Index: FulfillmentServiceTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.Data.NHibernate.Northwind/test/Spring.Northwind.IntegrationTests/IntegrationTests/FulfillmentServiceTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FulfillmentServiceTests.cs 18 Jun 2007 20:04:29 -0000 1.2 --- FulfillmentServiceTests.cs 29 Sep 2007 17:31:55 -0000 1.3 *************** *** 47,51 **** /// configuration of a TransactionProxyFactoryObject /// </summary> ! [Test] public void ProcessCustomerViaTxProxyFactoryObject() { --- 47,51 ---- /// configuration of a TransactionProxyFactoryObject /// </summary> ! [Test,Explicit( "choose DeclarativeServicesTxProxyFactoryDriven.xml in Services.xml before running this test" )] public void ProcessCustomerViaTxProxyFactoryObject() { *************** *** 60,63 **** --- 60,64 ---- /// </summary> [Test] + //[Explicit( "choose DeclarativeServicesAttributeDriven.xml in Services.xml before running this test" )] public void ProcessCustomer() { |
From: Erich E. <oak...@us...> - 2007-09-29 17:31:57
|
Update of /cvsroot/springnet/Spring.Net In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11150 Modified Files: Spring.Net.1.1.2005.sln Log Message: fixed integration tests in nh-northwind sample Index: Spring.Net.1.1.2005.sln =================================================================== RCS file: /cvsroot/springnet/Spring.Net/Spring.Net.1.1.2005.sln,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Spring.Net.1.1.2005.sln 14 Sep 2007 15:45:50 -0000 1.14 --- Spring.Net.1.1.2005.sln 29 Sep 2007 17:31:54 -0000 1.15 *************** *** 274,276 **** --- 274,279 ---- HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + NAntAddinLastFileName = Spring.build + EndGlobalSection EndGlobal |
From: Bruno B. <bb...@us...> - 2007-09-24 11:54:00
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv8898/doc/reference/src Modified Files: remoting.xml Log Message: Update to the iis-application section. Spring.Web now ensures context is initialized. Index: remoting.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/remoting.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** remoting.xml 25 Apr 2007 22:24:32 -0000 1.19 --- remoting.xml 24 Sep 2007 11:50:17 -0000 1.20 *************** *** 219,229 **** <title>IIS Application Configuration</title> ! <para>If you are deploying a .NET remoting application inside IIS there ! is a <ulink ! url="http://forum.springframework.net/showthread.php?t=469">sample ! project </ulink>that demonstrates the necessary configuration. The basic ! idea is to start the initialization of the Spring IoC container inside ! the application start method defined in Global.asax, as shown ! below</para> <programlisting> void Application_Start(object sender, EventArgs e) --- 219,229 ---- <title>IIS Application Configuration</title> ! <para>If you are deploying a .NET remoting application inside IIS there is a ! <ulink url="http://forum.springframework.net/showthread.php?t=469">sample project </ulink> ! that demonstrates the necessary configuration using Spring.Web.</para> ! ! <para>Spring.Web ensures the application context is initialized, but if you don't use ! Spring.Web the idea is to start the initialization of the Spring IoC container inside ! the application start method defined in Global.asax, as shown below</para> <programlisting> void Application_Start(object sender, EventArgs e) |
From: Erich E. <oak...@us...> - 2007-09-23 07:55:31
|
Update of /cvsroot/springnet/Spring.Net In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv2112 Modified Files: BreakingChanges-1.1.txt Log Message: fixed RemotingConfigParser name Index: BreakingChanges-1.1.txt =================================================================== RCS file: /cvsroot/springnet/Spring.Net/BreakingChanges-1.1.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** BreakingChanges-1.1.txt 9 Aug 2007 19:01:33 -0000 1.15 --- BreakingChanges-1.1.txt 23 Sep 2007 07:55:26 -0000 1.16 *************** *** 118,122 **** ! 1. Moved Remoting.RemotingConfigParser to Remoting.Config.RemotingNamespaceParser --- 118,122 ---- ! 1. Moved Spring.Remoting.RemotingConfigParser to Spring.Remoting.Config.RemotingNamespaceParser |
From: Bruno B. <bb...@us...> - 2007-09-21 14:27:42
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Services.Tests/ServiceModel In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29942/ServiceModel Added Files: ServiceExporterTests.cs Log Message: Minor update of the WCF service exporter. --- NEW FILE: ServiceExporterTests.cs --- (This appears to be a binary file; contents omitted.) |
From: Bruno B. <bb...@us...> - 2007-09-21 14:27:42
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Services.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29942 Modified Files: Spring.Services.Tests.2008.csproj Log Message: Minor update of the WCF service exporter. Index: Spring.Services.Tests.2008.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Services.Tests/Spring.Services.Tests.2008.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Spring.Services.Tests.2008.csproj 14 Sep 2007 16:13:38 -0000 1.1 --- Spring.Services.Tests.2008.csproj 21 Sep 2007 14:27:35 -0000 1.2 *************** *** 128,131 **** --- 128,132 ---- <SubType>Code</SubType> </Compile> + <Compile Include="ServiceModel\ServiceExporterTests.cs" /> <Compile Include="Web\Services\WebServiceProxyFactoryTests.cs" /> <EmbeddedResource Include="Data\Spring\Web\Services\rpc-literal.wsdl" /> *************** *** 181,187 **** <EmbeddedResource Include="Data\Spring\Web\Services\configurableFactory.xml" /> </ItemGroup> - <ItemGroup> - <Folder Include="ServiceModel\" /> - </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> --- 182,185 ---- |
From: Bruno B. <bb...@us...> - 2007-09-21 14:27:10
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29588 Modified Files: WebServiceExporter.cs Log Message: Minor update of the WCF service exporter. Index: WebServiceExporter.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** WebServiceExporter.cs 31 Jul 2007 18:19:16 -0000 1.23 --- WebServiceExporter.cs 21 Sep 2007 14:27:04 -0000 1.24 *************** *** 147,152 **** /// </summary> /// <remarks> ! /// The default value of this property is all the interfaces ! /// implemented or inherited by the target type. /// </remarks> /// <value>The interfaces.</value> --- 147,152 ---- /// </summary> /// <remarks> ! /// If not set, all the interfaces implemented or inherited ! /// by the target type will be used. /// </remarks> /// <value>The interfaces.</value> |
From: Bruno B. <bb...@us...> - 2007-09-21 14:26:32
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Services/ServiceModel In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29391 Modified Files: ServiceExporter.cs Log Message: Minor update of the WCF service exporter. Index: ServiceExporter.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Services/ServiceModel/ServiceExporter.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServiceExporter.cs 18 May 2007 21:04:37 -0000 1.1 --- ServiceExporter.cs 21 Sep 2007 14:26:26 -0000 1.2 *************** *** 23,29 **** --- 23,31 ---- using System; + using System.Collections; using Spring.Util; using Spring.Context; + using Spring.Core.TypeResolution; using Spring.Objects; using Spring.Objects.Factory; *************** *** 31,34 **** --- 33,37 ---- using Spring.ServiceModel.Support; using Spring.Context.Support; + using Spring.Proxy; #endregion *************** *** 52,55 **** --- 55,61 ---- private string targetName; + private string[] _contracts; + private IList _typeAttributes = new ArrayList(); + private IDictionary _memberAttributes = new Hashtable(); private IApplicationContext applicationContext; *************** *** 82,85 **** --- 88,130 ---- } + /// <summary> + /// Gets or sets the list of service contracts. + /// </summary> + /// <remarks> + /// If not set, all the interfaces implemented or inherited + /// by the target type will be used. + /// </remarks> + /// <value>The interfaces.</value> + public string[] Contracts + { + get { return _contracts; } + set { _contracts = value; } + } + + /// <summary> + /// Gets or sets a list of custom attributes + /// that should be applied to the WCF service class. + /// </summary> + public IList TypeAttributes + { + get { return _typeAttributes; } + set { _typeAttributes = value; } + } + + /// <summary> + /// Gets or sets a dictionary of custom attributes + /// that should be applied to the WCF service members. + /// </summary> + /// <remarks> + /// Dictionary key is an expression that members can be matched against. + /// Value is a list of attributes that should be applied + /// to each member that matches expression. + /// </remarks> + public IDictionary MemberAttributes + { + get { return _memberAttributes; } + set { _memberAttributes = value; } + } + #endregion *************** *** 149,153 **** string contextName = (applicationContext.Name == AbstractApplicationContext.DefaultRootContextName) ? null : applicationContext.Name; Type targetType = objectFactory.GetType(targetName); ! Type serviceType = new ServiceProxyTypeBuilder(contextName, targetName, targetType).BuildProxyType(); serviceHost = new System.ServiceModel.ServiceHost(serviceType); --- 194,206 ---- string contextName = (applicationContext.Name == AbstractApplicationContext.DefaultRootContextName) ? null : applicationContext.Name; Type targetType = objectFactory.GetType(targetName); ! IProxyTypeBuilder builder = new ServiceProxyTypeBuilder(contextName, targetName, targetType); ! if (Contracts != null && Contracts.Length > 0) ! { ! builder.Interfaces = TypeResolutionUtils.ResolveInterfaceArray(Contracts); ! } ! builder.TypeAttributes = TypeAttributes; ! builder.MemberAttributes = MemberAttributes; ! ! Type serviceType = builder.BuildProxyType(); serviceHost = new System.ServiceModel.ServiceHost(serviceType); |
From: Bruno B. <bb...@us...> - 2007-09-21 13:30:40
|
Update of /cvsroot/springnet/Spring.Net/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerApp In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31509 Modified Files: App.config Log Message: Fixed aop schema namespace. Index: App.config =================================================================== RCS file: /cvsroot/springnet/Spring.Net/examples/Spring/Spring.WcfQuickStart/src/Spring.WcfQuickStart.ServerApp/App.config,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** App.config 8 Aug 2007 03:13:30 -0000 1.3 --- App.config 21 Sep 2007 13:30:31 -0000 1.4 *************** *** 24,28 **** <parsers> ! <parser namespace="http://www.springframework.net/schema/aop" type="Spring.Aop.Config.AopNamespaceParser, Spring.Aop" schemaLocation="assembly://Spring.Aop/Spring.Aop.Config/spring-aop-1.1.xsd" /> --- 24,28 ---- <parsers> ! <parser namespace="http://www.springframework.net/aop" type="Spring.Aop.Config.AopNamespaceParser, Spring.Aop" schemaLocation="assembly://Spring.Aop/Spring.Aop.Config/spring-aop-1.1.xsd" /> *************** *** 31,40 **** <objects xmlns="http://www.springframework.net" ! xmlns:aop="http://www.springframework.net/schema/aop"> ! ! <object id="serviceOperation" type="Spring.Aop.Support.SdkRegularExpressionMethodPointcut, Spring.Aop"> ! <property name="pattern" value="Spring.WcfQuickStart.*"/> ! </object> ! <!-- Service definition --> <object id="calculator" --- 31,36 ---- <objects xmlns="http://www.springframework.net" ! xmlns:aop="http://www.springframework.net/aop"> ! <!-- Service definition --> <object id="calculator" *************** *** 47,60 **** </object> ! <object id="perfAdvice" type="Spring.WcfQuickStart.SimplePerformanceInterceptor, Spring.WcfQuickStart.ServerApp"> <property name="Prefix" value="Service Layer Performance"/> </object> ! <aop:config> - - <aop:advisor pointcut-ref="serviceOperation" advice-ref="perfAdvice"/> - </aop:config> --- 43,56 ---- </object> ! <object id="serviceOperation" type="Spring.Aop.Support.SdkRegularExpressionMethodPointcut, Spring.Aop"> ! <property name="pattern" value="Spring.WcfQuickStart.*"/> ! </object> ! <object id="perfAdvice" type="Spring.WcfQuickStart.SimplePerformanceInterceptor, Spring.WcfQuickStart.ServerApp"> <property name="Prefix" value="Service Layer Performance"/> </object> ! <aop:config> <aop:advisor pointcut-ref="serviceOperation" advice-ref="perfAdvice"/> </aop:config> |
From: Bruno B. <bb...@us...> - 2007-09-20 14:35:33
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27944/test/Spring/Spring.Core.Tests/Core Modified Files: MethodParametersCountCriteriaTests.cs Log Message: MethodParametersCriteria and MethodParametersCountCriteria take into account 'params' parameter. Index: MethodParametersCountCriteriaTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Core/MethodParametersCountCriteriaTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MethodParametersCountCriteriaTests.cs 20 Sep 2007 14:20:46 -0000 1.2 --- MethodParametersCountCriteriaTests.cs 20 Sep 2007 14:35:29 -0000 1.3 *************** *** 68,71 **** --- 68,80 ---- MethodInfo method = GetType ().GetMethod ("NoParameter", BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue (criteria.IsSatisfied (method)); + + criteria = new MethodParametersCountCriteria(0); + method = GetType().GetMethod("NoParameter", BindingFlags.Public | BindingFlags.Instance); + Assert.IsTrue(criteria.IsSatisfied(method)); + + criteria = new MethodParametersCountCriteria(); + criteria.ExpectedParameterCount = 0; + method = GetType().GetMethod("NoParameter", BindingFlags.Public | BindingFlags.Instance); + Assert.IsTrue(criteria.IsSatisfied(method)); } *************** *** 73,77 **** public void IsSatisfiedWithOneParameter () { ! MethodParametersCountCriteria criteria = new MethodParametersCountCriteria (); MethodInfo method = GetType().GetMethod("OneParameter", BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue (criteria.IsSatisfied (method)); --- 82,86 ---- public void IsSatisfiedWithOneParameter () { ! MethodParametersCountCriteria criteria = new MethodParametersCountCriteria (1); MethodInfo method = GetType().GetMethod("OneParameter", BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue (criteria.IsSatisfied (method)); |
From: Bruno B. <bb...@us...> - 2007-09-20 14:20:58
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17775/src/Spring/Spring.Core/Core Modified Files: MethodParametersCountCriteria.cs MethodParametersCriteria.cs Log Message: MethodParametersCriteria and MethodParametersCountCriteria take into account 'params' parameter. Index: MethodParametersCountCriteria.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/MethodParametersCountCriteria.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MethodParametersCountCriteria.cs 31 Jul 2007 02:03:36 -0000 1.1 --- MethodParametersCountCriteria.cs 20 Sep 2007 14:20:45 -0000 1.2 *************** *** 124,128 **** if (method != null) { ! satisfied = method.GetParameters().Length == ExpectedParameterCount; } return satisfied; --- 124,137 ---- if (method != null) { ! ParameterInfo[] parameters = method.GetParameters(); ! if (parameters.Length == ExpectedParameterCount) ! { ! satisfied = true; ! } ! else if ((parameters.Length > 0) && (ExpectedParameterCount >= parameters.Length-1)) ! { ! ParameterInfo lastParameter = parameters[parameters.Length - 1]; ! satisfied = lastParameter.GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0; ! } } return satisfied; Index: MethodParametersCriteria.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Core/MethodParametersCriteria.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MethodParametersCriteria.cs 31 Jul 2007 02:03:36 -0000 1.1 --- MethodParametersCriteria.cs 20 Sep 2007 14:20:46 -0000 1.2 *************** *** 105,110 **** if (method != null) { ! Type[] parametersBeingChecked ! = ReflectionUtils.GetParameterTypes(method); if (parametersBeingChecked != null && parametersBeingChecked.Length == _parameters.Length) --- 105,120 ---- if (method != null) { ! bool isParamArray = false; ! Type paramArrayType = null; ! ParameterInfo[] parametersBeingChecked = method.GetParameters(); ! if (parametersBeingChecked.Length > 0) ! { ! ParameterInfo lastParameter = parametersBeingChecked[parametersBeingChecked.Length - 1]; ! isParamArray = lastParameter.GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0; ! if (isParamArray) ! { ! paramArrayType = lastParameter.ParameterType.GetElementType(); ! } ! } if (parametersBeingChecked != null && parametersBeingChecked.Length == _parameters.Length) *************** *** 114,118 **** { Type sourceType = _parameters[i]; ! Type typeBeingChecked = parametersBeingChecked[i]; if (!typeBeingChecked.IsAssignableFrom(sourceType)) { --- 124,153 ---- { Type sourceType = _parameters[i]; ! Type typeBeingChecked = parametersBeingChecked[i].ParameterType; ! if (!typeBeingChecked.IsAssignableFrom(sourceType)) ! { ! if (isParamArray && i == _parameters.Length - 1) ! { ! if (!paramArrayType.IsAssignableFrom(sourceType)) ! { ! satisfied = false; ! break; ! } ! } ! else ! { ! satisfied = false; ! break; ! } ! } ! } ! } ! else if (isParamArray && (_parameters.Length >= parametersBeingChecked.Length - 1)) ! { ! satisfied = true; ! for (int i = 0; i < parametersBeingChecked.Length - 1; ++i) ! { ! Type sourceType = _parameters[i]; ! Type typeBeingChecked = parametersBeingChecked[i].ParameterType; if (!typeBeingChecked.IsAssignableFrom(sourceType)) { *************** *** 121,124 **** --- 156,168 ---- } } + for (int i = parametersBeingChecked.Length - 1; i < _parameters.Length; ++i) + { + Type sourceType = _parameters[i]; + if (!paramArrayType.IsAssignableFrom(sourceType)) + { + satisfied = false; + break; + } + } } } |
From: Bruno B. <bb...@us...> - 2007-09-20 14:20:52
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17775/test/Spring/Spring.Core.Tests/Core Modified Files: MethodParametersCountCriteriaTests.cs MethodParametersCriteriaTests.cs Log Message: MethodParametersCriteria and MethodParametersCountCriteria take into account 'params' parameter. Index: MethodParametersCriteriaTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Core/MethodParametersCriteriaTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MethodParametersCriteriaTests.cs 4 Aug 2007 01:05:52 -0000 1.1 --- MethodParametersCriteriaTests.cs 20 Sep 2007 14:20:47 -0000 1.2 *************** *** 76,79 **** --- 76,103 ---- } + [Test] + public void IsSatisfiedWithParamsParameters() + { + MethodParametersCriteria criteria = new MethodParametersCriteria(new Type[] { typeof(int), typeof(string) }); + MethodInfo method = GetType().GetMethod("ParamsParameters"); + Assert.IsTrue(criteria.IsSatisfied(method), "Was not satisified with a method that takes a parameter array ('params') as a parameter."); + + criteria = new MethodParametersCriteria(new Type[] { typeof(int), typeof(string[]) }); + method = GetType().GetMethod("ParamsParameters"); + Assert.IsTrue(criteria.IsSatisfied(method), "Was not satisified with a method that takes a parameter array ('params') as a parameter."); + + criteria = new MethodParametersCriteria(new Type[] { typeof(int) }); + method = GetType().GetMethod("ParamsParameters"); + Assert.IsTrue(criteria.IsSatisfied(method), "Was not satisified with a method that takes a parameter array ('params') as a parameter."); + + criteria = new MethodParametersCriteria(new Type[] { typeof(int), typeof(string), typeof(string), typeof(string) }); + method = GetType().GetMethod("ParamsParameters"); + Assert.IsTrue(criteria.IsSatisfied(method), "Was not satisified with a method that takes a parameter array ('params') as a parameter."); + + criteria = new MethodParametersCriteria(new Type[] { typeof(int), typeof(string[]), typeof(string) }); + method = GetType().GetMethod("ParamsParameters"); + Assert.IsFalse(criteria.IsSatisfied(method), "Was not satisified with a method that takes a parameter array ('params') as a parameter."); + } + // some methods for testing signatures... public void Foo () *************** *** 93,96 **** --- 117,124 ---- { } + + public void ParamsParameters(int foo, params string[] strs) + { + } } } Index: MethodParametersCountCriteriaTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Core/MethodParametersCountCriteriaTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MethodParametersCountCriteriaTests.cs 4 Aug 2007 01:05:52 -0000 1.1 --- MethodParametersCountCriteriaTests.cs 20 Sep 2007 14:20:46 -0000 1.2 *************** *** 39,43 **** { [Test] ! public void Instantiation () { MethodParametersCountCriteria criteria = new MethodParametersCountCriteria (); Assert.AreEqual (0, criteria.ExpectedParameterCount); --- 39,44 ---- { [Test] ! public void Instantiation () ! { MethodParametersCountCriteria criteria = new MethodParametersCountCriteria (); Assert.AreEqual (0, criteria.ExpectedParameterCount); *************** *** 62,81 **** [Test] ! public void IsSatisfied () { MethodParametersCountCriteria criteria = new MethodParametersCountCriteria (); MethodInfo method = GetType ().GetMethod ("NoParameter", BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue (criteria.IsSatisfied (method)); ! criteria = new MethodParametersCountCriteria (1); ! method = GetType ().GetMethod ("OneParameter", BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue (criteria.IsSatisfied (method)); ! criteria = new MethodParametersCountCriteria (2); ! method = GetType ().GetMethod ("TwoParameters", BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue (criteria.IsSatisfied (method)); } [Test] public void IsNotSatisfiedWithNull () { --- 63,110 ---- [Test] ! public void IsSatisfiedWithNoParameter () { MethodParametersCountCriteria criteria = new MethodParametersCountCriteria (); MethodInfo method = GetType ().GetMethod ("NoParameter", BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue (criteria.IsSatisfied (method)); + } ! [Test] ! public void IsSatisfiedWithOneParameter () ! { ! MethodParametersCountCriteria criteria = new MethodParametersCountCriteria (); ! MethodInfo method = GetType().GetMethod("OneParameter", BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue (criteria.IsSatisfied (method)); + } ! [Test] ! public void IsSatisfiedWithTwoParameters () ! { ! MethodParametersCountCriteria criteria = new MethodParametersCountCriteria(2); ! MethodInfo method = GetType().GetMethod("TwoParameters", BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue (criteria.IsSatisfied (method)); } [Test] + public void IsSatisfiedWithParamsParameters () + { + MethodParametersCountCriteria criteria = new MethodParametersCountCriteria(1); + MethodInfo method = GetType().GetMethod("ParamsParameters", BindingFlags.Public | BindingFlags.Instance); + Assert.IsFalse(criteria.IsSatisfied(method)); + + criteria = new MethodParametersCountCriteria(2); + method = GetType().GetMethod("ParamsParameters", BindingFlags.Public | BindingFlags.Instance); + Assert.IsTrue(criteria.IsSatisfied(method)); + + criteria = new MethodParametersCountCriteria (3); + method = GetType().GetMethod("ParamsParameters", BindingFlags.Public | BindingFlags.Instance); + Assert.IsTrue (criteria.IsSatisfied (method)); + + criteria = new MethodParametersCountCriteria(5); + method = GetType().GetMethod("ParamsParameters", BindingFlags.Public | BindingFlags.Instance); + Assert.IsTrue(criteria.IsSatisfied(method)); + } + + [Test] public void IsNotSatisfiedWithNull () { *************** *** 96,99 **** --- 125,132 ---- { } + + public void ParamsParameters(int foo, int bar, params string[] strs) + { + } } } |
From: Bruno B. <bb...@us...> - 2007-09-20 12:31:07
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27343/src/Spring/Spring.Data/Transaction/Interceptor Modified Files: AbstractFallbackTransactionAttributeSource.cs MethodMapTransactionAttributeSource.cs Log Message: ReflectionUtils.getMostSpecificMethod() throws exception when handling Generic methods with the same parameter signature and different generic types [SPRNET-722] Index: MethodMapTransactionAttributeSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor/MethodMapTransactionAttributeSource.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MethodMapTransactionAttributeSource.cs 17 Sep 2007 19:16:05 -0000 1.10 --- MethodMapTransactionAttributeSource.cs 20 Sep 2007 12:31:01 -0000 1.11 *************** *** 28,31 **** --- 28,32 ---- using Spring.Util; using Spring.Core.TypeResolution; + using Spring.Core; #endregion *************** *** 239,252 **** //Might have registered MethodInfo objects whose declaring type is the interface, so 'downcast' //to the most specific method which is typically what is passed in as the first method argument. ! foreach (DictionaryEntry dictionaryEntry in _methodMap) ! { ! MethodInfo specificMethod = ! ReflectionUtils.GetMostSpecificMethod((MethodInfo) dictionaryEntry.Key, targetType); ! if (method == specificMethod) { ! return (ITransactionAttribute) dictionaryEntry.Value; } ! } return (ITransactionAttribute)_methodMap[method]; } --- 240,284 ---- //Might have registered MethodInfo objects whose declaring type is the interface, so 'downcast' //to the most specific method which is typically what is passed in as the first method argument. ! foreach (DictionaryEntry dictionaryEntry in _methodMap) ! { ! MethodInfo currentMethod = (MethodInfo)dictionaryEntry.Key; ! ! MethodInfo specificMethod; ! if (targetType == null) { ! specificMethod = currentMethod; ! } ! else ! { ! ComposedCriteria searchCriteria = new ComposedCriteria(); ! searchCriteria.Add(new MethodNameMatchCriteria(currentMethod.Name)); ! searchCriteria.Add(new MethodParametersCountCriteria(currentMethod.GetParameters().Length)); ! #if NET_2_0 ! searchCriteria.Add(new MethodGenericArgumentsCountCriteria( ! currentMethod.GetGenericArguments().Length)); ! #endif ! searchCriteria.Add(new MethodParametersCriteria(ReflectionUtils.GetParameterTypes(currentMethod))); ! ! MemberInfo[] matchingMethods = targetType.FindMembers( ! MemberTypes.Method, ! BindingFlags.Instance | BindingFlags.Public, ! new MemberFilter(new CriteriaMemberFilter().FilterMemberByCriteria), ! searchCriteria); ! ! if (matchingMethods != null && matchingMethods.Length == 1) ! { ! specificMethod = matchingMethods[0] as MethodInfo; ! } ! else ! { ! specificMethod = currentMethod; ! } } ! if (method == specificMethod) ! { ! return (ITransactionAttribute)dictionaryEntry.Value; ! } ! } return (ITransactionAttribute)_methodMap[method]; } Index: AbstractFallbackTransactionAttributeSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Transaction/Interceptor/AbstractFallbackTransactionAttributeSource.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AbstractFallbackTransactionAttributeSource.cs 28 Jan 2007 20:12:33 -0000 1.7 --- AbstractFallbackTransactionAttributeSource.cs 20 Sep 2007 12:31:01 -0000 1.8 *************** *** 22,27 **** --- 22,29 ---- using System.Collections; using System.Reflection; + using Spring.Collections; using Spring.Util; + using Spring.Core; namespace Spring.Transaction.Interceptor *************** *** 231,249 **** } ! private ITransactionAttribute computeTransactionAttribute(MethodInfo method, Type targetType) ! { ! MethodInfo specificMethod = ReflectionUtils.GetMostSpecificMethod(method, targetType); ! ITransactionAttribute transactionAttribute = getTransactionAttribute(specificMethod); ! if (null != transactionAttribute) ! { ! return transactionAttribute; ! } ! else if (specificMethod != method) ! { ! transactionAttribute = getTransactionAttribute(method); ! } ! return null; ! } private ITransactionAttribute getTransactionAttribute(MethodInfo methodInfo) --- 233,281 ---- } ! private ITransactionAttribute computeTransactionAttribute(MethodInfo method, Type targetType) ! { ! MethodInfo specificMethod; ! if (targetType == null) ! { ! specificMethod = method; ! } ! else ! { ! ComposedCriteria searchCriteria = new ComposedCriteria(); ! searchCriteria.Add(new MethodNameMatchCriteria(method.Name)); ! searchCriteria.Add(new MethodParametersCountCriteria(method.GetParameters().Length)); ! #if NET_2_0 ! searchCriteria.Add(new MethodGenericArgumentsCountCriteria( ! method.GetGenericArguments().Length)); ! #endif ! searchCriteria.Add(new MethodParametersCriteria(ReflectionUtils.GetParameterTypes(method))); ! MemberInfo[] matchingMethods = targetType.FindMembers( ! MemberTypes.Method, ! BindingFlags.Instance | BindingFlags.Public, ! new MemberFilter(new CriteriaMemberFilter().FilterMemberByCriteria), ! searchCriteria); ! ! if (matchingMethods != null && matchingMethods.Length == 1) ! { ! specificMethod = matchingMethods[0] as MethodInfo; ! } ! else ! { ! specificMethod = method; ! } ! } ! ! ITransactionAttribute transactionAttribute = getTransactionAttribute(specificMethod); ! if (null != transactionAttribute) ! { ! return transactionAttribute; ! } ! else if (specificMethod != method) ! { ! transactionAttribute = getTransactionAttribute(method); ! } ! return null; ! } private ITransactionAttribute getTransactionAttribute(MethodInfo methodInfo) |
From: Bruno B. <bb...@us...> - 2007-09-20 12:31:06
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27343/src/Spring/Spring.Core/Util Modified Files: ReflectionUtils.cs Log Message: ReflectionUtils.getMostSpecificMethod() throws exception when handling Generic methods with the same parameter signature and different generic types [SPRNET-722] Index: ReflectionUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util/ReflectionUtils.cs,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** ReflectionUtils.cs 27 Aug 2007 13:57:18 -0000 1.49 --- ReflectionUtils.cs 20 Sep 2007 12:31:01 -0000 1.50 *************** *** 190,243 **** /// <summary> - /// Finds that method on the supplied <paramref name="type"/> that most - /// closely matches the supplied <paramref name="method"/>. - /// if there is one. - /// </summary> - /// <remarks> - /// <p> - /// For example, the supplied <paramref name="method"/> may be - /// <c>IFoo.Bar()</c> (i.e. the <c>Bar()</c> method from the - /// <c>IFoo</c> interface), and the supplied <paramref name="type"/> - /// may be the <c>DefaultFoo</c> class that just so happens to declare - /// a <c>Bar()</c> method. This method will return the - /// <c>DefaultFoo.Bar()</c> method because this method most closely - /// matches the name and parameters of the supplied - /// <paramref name="method"/>. This is useful because it enables - /// attributes on that method to be found. - /// </p> - /// </remarks> - /// <param name="method"> - /// The method to be invoked, which may come from an interface. - /// </param> - /// <param name="type"> - /// The target <see cref="System.Type"/> for the current invocation. - /// May be <see langword="null"/> or may not even implement the method. - /// </param> - /// <returns> - /// The more specific method, or the original method if the - /// <paramref name="type"/> doesn't specialize it or implement - /// it, or is <see langword="null"/>. - /// </returns> - /// <exception cref="System.ArgumentNullException"> - /// If <paramref name="method"/> is <see langword="null"/>. - /// </exception> - public static MethodInfo GetMostSpecificMethod(MethodInfo method, Type type) - { - AssertUtils.ArgumentNotNull(method, "method"); - if (type != null) - { - MethodInfo original = method; - method = type.GetMethod(method.Name, GetParameterTypes(method.GetParameters())); - if (method == null) - { - // perhaps the target class doesn't implement this method... - // that's fine, just use the original method - method = original; - } - } - return method; - } - - /// <summary> /// From a given list of methods, selects the method having an exact match on the given <paramref name="argValues"/>' types. /// </summary> --- 190,193 ---- |
From: Bruno B. <bb...@us...> - 2007-09-20 12:31:06
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Util In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27343/test/Spring/Spring.Core.Tests/Util Modified Files: ReflectionUtilsTests.cs Log Message: ReflectionUtils.getMostSpecificMethod() throws exception when handling Generic methods with the same parameter signature and different generic types [SPRNET-722] Index: ReflectionUtilsTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsTests.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ReflectionUtilsTests.cs 8 Aug 2007 08:25:54 -0000 1.17 --- ReflectionUtilsTests.cs 20 Sep 2007 12:31:01 -0000 1.18 *************** *** 210,248 **** [Test] - [ExpectedException(typeof (ArgumentNullException))] - public void GetMostSpecificMethodWithAllNulls() - { - ReflectionUtils.GetMostSpecificMethod(null, null); - } - - [Test] - public void GetMostSpecificMethodWithJustTargetTypeNull() - { - MethodInfo method = GetType().GetMethod("GetMostSpecificMethodWithJustTargetTypeNull"); - MethodInfo actual = ReflectionUtils.GetMostSpecificMethod(method, null); - Assert.IsNotNull(actual); - Assert.IsTrue(object.ReferenceEquals(method, actual)); - } - - [Test] - public void GetMostSpecificMethodWithClassThatDoesntExplicitlyImplementInterfaceMethod() - { - MethodInfo method = typeof (IFoo).GetMethod("Spanglish"); - MethodInfo actual = ReflectionUtils.GetMostSpecificMethod(method, typeof (ReflectionUtilsObject)); - Assert.IsNotNull(actual); - // make sure we got the method on the type, not just what we passed in - Assert.IsFalse(object.ReferenceEquals(method, actual)); - } - - [Test] - public void GetMostSpecificMethodWithClassThatDoesntHaveSuchAMethod() - { - MethodInfo method = GetType().GetMethod("GetMostSpecificMethodWithClassThatDoesntHaveSuchAMethod"); - MethodInfo actual = ReflectionUtils.GetMostSpecificMethod(method, typeof (ReflectionUtilsObject)); - Assert.IsNotNull(actual); - Assert.IsTrue(object.ReferenceEquals(method, actual)); - } - - [Test] public void GetSignature() { --- 210,213 ---- |
From: Mark P. <mar...@us...> - 2007-09-19 22:58:27
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12589 Modified Files: HibernateTemplate.cs HibernateTransactionManager.cs ICommonHibernateOperations.cs IHibernateCallback.cs IHibernateOperations.cs SessionFactoryUtils.cs Log Message: SPRNET-729 - Improve API documentation in NHibernate12 project using comment-checker program SPRNET-728 - Add missing ExecuteFind<T> method on IHibernateOperations interface Index: IHibernateCallback.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateCallback.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IHibernateCallback.cs 31 May 2007 20:25:13 -0000 1.1 --- IHibernateCallback.cs 19 Sep 2007 22:58:22 -0000 1.2 *************** *** 52,55 **** --- 52,56 ---- /// </p> /// </remarks> + /// <returns>A result object, or null if none.</returns> object DoInHibernate(ISession session); } Index: ICommonHibernateOperations.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/ICommonHibernateOperations.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ICommonHibernateOperations.cs 31 May 2007 20:25:13 -0000 1.1 --- ICommonHibernateOperations.cs 19 Sep 2007 22:58:22 -0000 1.2 *************** *** 24,27 **** --- 24,28 ---- using NHibernate; using NHibernate.Type; + using Spring.Dao; #endregion *************** *** 41,45 **** /// for details on those methods. /// </p> ! /// </remarks> public interface ICommonHibernateOperations { --- 42,49 ---- /// for details on those methods. /// </p> ! /// </remarks> ! /// <author>Mark Pollack (.NET)</author> ! /// <threadsafety statis="true" instance="true"/> ! /// <version>$Id$</version> public interface ICommonHibernateOperations { *************** *** 48,58 **** /// updates and deletes. /// </summary> void Clear(); - //TODO: - //void CloseIterator(); - - - /// <summary> --- 52,58 ---- /// updates and deletes. /// </summary> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Clear(); /// <summary> *************** *** 60,63 **** --- 60,64 ---- /// </summary> /// <param name="entity">The persistent instance to delete.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Delete(object entity); *************** *** 72,75 **** --- 73,77 ---- /// <param name="entity">Tthe persistent instance to delete.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Delete(object entity, LockMode lockMode); *************** *** 80,83 **** --- 82,86 ---- /// <param name="queryString">a query expressed in Hibernate's query language.</param> /// <returns>The number of entity instances deleted.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> int Delete(string queryString); *************** *** 89,92 **** --- 92,96 ---- /// <param name="type">The Hibernate type of the parameter (or <code>null</code>).</param> /// <returns>The number of entity instances deleted.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> int Delete(string queryString, object value, IType type); *************** *** 99,102 **** --- 103,107 ---- /// <param name="types"> Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>The number of entity instances deleted.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> int Delete(String queryString, Object[] values, IType[] types); *************** *** 110,113 **** --- 115,119 ---- /// to rely on auto-flushing at transaction completion. /// </remarks> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Flush(); *************** *** 120,123 **** --- 126,131 ---- /// <param name="entity">Entity the object (of the target class) to load into.</param> /// <param name="id">An identifier of the persistent instance.</param> + /// <exception cref="ObjectRetrievalFailureException">If object not found.</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Load(object entity, object id); *************** *** 127,130 **** --- 135,139 ---- /// </summary> /// <param name="entity">The persistent instance to re-read.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Refresh(object entity); *************** *** 135,138 **** --- 144,148 ---- /// <param name="entity">The persistent instance to re-read.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Refresh(object entity, LockMode lockMode); *************** *** 144,147 **** --- 154,158 ---- /// <c>true</c> if session cache contains the specified entity; otherwise, <c>false</c>. /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> bool Contains(object entity); *************** *** 150,155 **** --- 161,169 ---- /// </summary> /// <param name="entity">The persistent instance to evict.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Evict(object entity); + #endregion + #region Convenience methods for storing individual objects *************** *** 162,165 **** --- 176,181 ---- /// <param name="entity">The he persistent instance to lock.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="ObjectOptimisticLockingFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Lock(object entity, LockMode lockMode); *************** *** 170,173 **** --- 186,190 ---- /// <param name="entity">The transient instance to persist.</param> /// <returns>The generated identifier.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> object Save(object entity); *************** *** 177,180 **** --- 194,198 ---- /// <param name="entity">The transient instance to persist.</param> /// <param name="id">The identifier to assign.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Save(object entity, object id); *************** *** 183,186 **** --- 201,205 ---- /// </summary> /// <param name="entity">The persistent instance to update.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Update(object entity); *************** *** 193,196 **** --- 212,216 ---- /// <param name="entity">The persistent instance to update.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void Update(object entity, LockMode lockMode); *************** *** 201,204 **** --- 221,225 ---- /// <param name="entity">Tthe persistent instance to save or update /// (to be associated with the Hibernate Session).</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void SaveOrUpdate(object entity); *************** *** 214,217 **** --- 235,239 ---- /// <returns>The actually associated persistent object. /// (either an already loaded instance with the same id, or the given object)</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> object SaveOrUpdateCopy(object entity); *************** *** 219,223 **** #endregion ! #endregion } } --- 241,245 ---- #endregion ! } } Index: IHibernateOperations.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/IHibernateOperations.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IHibernateOperations.cs 31 May 2007 20:25:13 -0000 1.1 --- IHibernateOperations.cs 19 Sep 2007 22:58:22 -0000 1.2 *************** *** 25,28 **** --- 25,29 ---- using NHibernate; using NHibernate.Type; + using Spring.Dao; using Spring.Data.NHibernate; *************** *** 42,58 **** /// </p> /// </remarks> /// <author>Mark Pollack (.NET)</author> /// <version>$Id$</version> public interface IHibernateOperations : ICommonHibernateOperations { ! /// <summary> /// Delete all given persistent instances. /// </summary> /// <remarks> /// This can be combined with any of the find methods to delete by query /// in two lines of code, similar to Session's delete by query methods. /// </remarks> ! /// <param name="entities">The persistent instances to delete.</param> void DeleteAll(ICollection entities); --- 43,61 ---- /// </p> /// </remarks> + /// <threadsafety statis="true" instance="true"/> /// <author>Mark Pollack (.NET)</author> /// <version>$Id$</version> public interface IHibernateOperations : ICommonHibernateOperations { ! /// <summary> /// Delete all given persistent instances. /// </summary> + /// <param name="entities">The persistent instances to delete.</param> /// <remarks> /// This can be combined with any of the find methods to delete by query /// in two lines of code, similar to Session's delete by query methods. /// </remarks> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void DeleteAll(ICollection entities); *************** *** 74,77 **** --- 77,81 ---- /// <returns>a result object returned by the action, or <code>null</code> /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> object Execute(HibernateDelegate del); *************** *** 93,96 **** --- 97,101 ---- /// <returns>a result object returned by the action, or <code>null</code> /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> object Execute(IHibernateCallback action); *************** *** 104,108 **** /// </remarks> /// <param name="action">The calback object that specifies the Hibernate action.</param> ! /// <returns></returns> IList ExecuteFind(IHibernateCallback action); --- 109,115 ---- /// </remarks> /// <param name="action">The calback object that specifies the Hibernate action.</param> ! /// <returns>A IList returned by the action, or null ! /// </returns> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList ExecuteFind(IHibernateCallback action); *************** *** 113,117 **** /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <returns>a List containing 0 or more persistent instances</returns> ! IList Find(string queryString); --- 120,125 ---- /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <returns>a List containing 0 or more persistent instances</returns> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> ! IList Find(string queryString); *************** *** 123,126 **** --- 131,135 ---- /// <param name="value">the value of the parameter</param> /// <returns>a List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList Find(string queryString, object value); *************** *** 133,136 **** --- 142,146 ---- /// <param name="type">Hibernate type of the parameter (or <code>null</code>)</param> /// <returns>a List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList Find(string queryString, object value, IType type); *************** *** 143,146 **** --- 153,157 ---- /// <param name="values">the values of the parameters</param> /// <returns>a List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList Find(string queryString, object[] values); *************** *** 155,158 **** --- 166,171 ---- /// <param name="types">Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>a List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentException">If values and types are not null and their lengths are not equal</exception> IList Find(string queryString, object[] values, IType[] types); *************** *** 166,169 **** --- 179,183 ---- /// <param name="value">The value of the parameter</param> /// <returns>a List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedParam(string queryName, string paramName, object value); *************** *** 177,180 **** --- 191,195 ---- /// <param name="type">Hibernate type of the parameter (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedParam(string queryName, string paramName, object value, IType type); *************** *** 187,190 **** --- 202,206 ---- /// <param name="values">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedParam(string queryString, string[] paramNames, object[] values); *************** *** 199,202 **** --- 215,221 ---- /// <param name="types">Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If paramNames length is not equal to values length or + /// if paramNames length is not equal to types length (when types is not null)</exception> IList FindByNamedParam(string queryString, string[] paramNames, object[] values, IType[] types); *************** *** 207,210 **** --- 226,230 ---- /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedQuery(string queryName); *************** *** 217,220 **** --- 237,241 ---- /// <param name="value">The value of the parameter</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedQuery(string queryName, object value); *************** *** 228,231 **** --- 249,253 ---- /// <param name="type">Hibernate type of the parameter (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedQuery(string queryName, object value, IType type); *************** *** 239,242 **** --- 261,265 ---- /// <param name="values">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedQuery(string queryName, object[] values); *************** *** 251,254 **** --- 274,279 ---- /// <param name="types">Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If values and types are not null and their lengths differ.</exception> IList FindByNamedQuery(string queryName, object[] values, IType[] types); *************** *** 262,265 **** --- 287,291 ---- /// <param name="value">The value of the parameter</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedQueryAndNamedParam(string queryName, string paramName, object value); *************** *** 274,277 **** --- 300,304 ---- /// <param name="type">The Hibernate type of the parameter (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedQueryAndNamedParam(string queryName, string paramName, object value, IType type); *************** *** 285,288 **** --- 312,316 ---- /// <param name="values">The values of the parameters.</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedQueryAndNamedParam(string queryName, string[] paramNames, object[] values); *************** *** 298,301 **** --- 326,332 ---- /// <param name="types">Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If paramNames length is not equal to values length or + /// if paramNames length is not equal to types length (when types is not null)</exception> IList FindByNamedQueryAndNamedParam(string queryName, string[] paramNames, object[] values, IType[] types); *************** *** 309,312 **** --- 340,344 ---- /// <param name="valueObject">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByNamedQueryAndValueObject(string queryName, object valueObject); *************** *** 318,329 **** /// <param name="valueObject">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> IList FindByValueObject(string queryString, object valueObject); #endregion - - - - #region Convenience methods for loading individual objects --- 350,358 ---- /// <param name="valueObject">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList FindByValueObject(string queryString, object valueObject); #endregion #region Convenience methods for loading individual objects *************** *** 334,338 **** /// <param name="entityType">a persistent type.</param> /// <param name="id">An identifier of the persistent instance.</param> ! /// <returns>The persistent instance, or <code>null</code> if not found</returns> object Get(Type entityType, object id); --- 363,368 ---- /// <param name="entityType">a persistent type.</param> /// <param name="id">An identifier of the persistent instance.</param> ! /// <returns>the persistent instance, or null if not found</returns> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> object Get(Type entityType, object id); *************** *** 346,349 **** --- 376,381 ---- /// <param name="lockMode">The lock mode.</param> /// the persistent instance, or <code>null</code> if not found + /// <returns>the persistent instance, or null if not found</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> object Get(Type entityType, object id, LockMode lockMode); *************** *** 355,358 **** --- 387,392 ---- /// <param name="id">An identifier of the persistent instance.</param> /// <returns>The persistent instance</returns> + /// <exception cref="ObjectRetrievalFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> object Load(Type entityType, object id); *************** *** 366,369 **** --- 400,405 ---- /// <param name="lockMode">The lock mode.</param> /// <returns>The persistent instance</returns> + /// <exception cref="ObjectRetrievalFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> object Load(Type entityType, object id, LockMode lockMode); *************** *** 376,379 **** --- 412,416 ---- /// <param name="entityType">Type of the entity.</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList LoadAll(Type entityType); *************** *** 386,395 **** #region Convenience methods for storing individual objects - - - - - - /// <summary> /// Save or update all given persistent instances, --- 423,426 ---- *************** *** 398,405 **** /// <param name="entities">Tthe persistent instances to save or update /// (to be associated with the Hibernate Session)he entities.</param> void SaveOrUpdateAll(ICollection entities); - #endregion --- 429,436 ---- /// <param name="entities">Tthe persistent instances to save or update /// (to be associated with the Hibernate Session)he entities.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> void SaveOrUpdateAll(ICollection entities); #endregion Index: SessionFactoryUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/SessionFactoryUtils.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SessionFactoryUtils.cs 29 Jul 2007 19:39:36 -0000 1.2 --- SessionFactoryUtils.cs 19 Sep 2007 22:58:22 -0000 1.3 *************** *** 103,106 **** --- 103,107 ---- /// <param name="interceptor">The Hibernate entity interceptor, or <code>null</code> if none.</param> /// <returns>The new session.</returns> + /// <exception cref="DataAccessResourceFailureException">If could not open Hibernate session</exception> public static ISession GetNewSession(ISessionFactory sessionFactory, IInterceptor interceptor) { *************** *** 409,449 **** /// </summary> /// <param name="ex">The Hibernate exception that occured.</param> ! /// <returns></returns> ! public static DataAccessException ConvertHibernateAccessException(HibernateException ex) ! { ! if (ex is ADOException) { ! // ADOException during Hibernate access: only passed in here from custom code, ! // as HibernateTemplate etc will use AdoExceptionTranslator-based handling. ! return new HibernateAdoException("Ado Exception", (ADOException) ex); ! } ! if (ex is UnresolvableObjectException) { ! return new HibernateObjectRetrievalFailureException((UnresolvableObjectException) ex); ! } ! if (ex is ObjectNotFoundException) { ! return new HibernateObjectRetrievalFailureException((ObjectNotFoundException) ex); ! } ! if (ex is ObjectDeletedException) { ! return new HibernateObjectRetrievalFailureException((ObjectDeletedException) ex); ! } ! if (ex is WrongClassException) { ! return new HibernateObjectRetrievalFailureException((WrongClassException) ex); ! } ! if (ex is StaleObjectStateException) { ! return new HibernateOptimisticLockingFailureException((StaleObjectStateException) ex); ! } ! if (ex is QueryException) { ! return new HibernateQueryException((QueryException) ex); ! } ! ! if (ex is PersistentObjectException) { ! return new InvalidDataAccessApiUsageException(ex.Message, ex); ! } ! if (ex is TransientObjectException) { ! return new InvalidDataAccessApiUsageException(ex.Message, ex); ! } ! ! // fallback ! return new HibernateSystemException(ex); ! } /// <summary> --- 410,459 ---- /// </summary> /// <param name="ex">The Hibernate exception that occured.</param> ! /// <returns>DataAccessException instance</returns> ! public static DataAccessException ConvertHibernateAccessException(HibernateException ex) ! { ! if (ex is ADOException) ! { ! // ADOException during Hibernate access: only passed in here from custom code, ! // as HibernateTemplate etc will use AdoExceptionTranslator-based handling. ! return new HibernateAdoException("Ado Exception", (ADOException) ex); ! } ! if (ex is UnresolvableObjectException) ! { ! return new HibernateObjectRetrievalFailureException((UnresolvableObjectException) ex); ! } ! if (ex is ObjectNotFoundException) ! { ! return new HibernateObjectRetrievalFailureException((ObjectNotFoundException) ex); ! } ! if (ex is ObjectDeletedException) ! { ! return new HibernateObjectRetrievalFailureException((ObjectDeletedException) ex); ! } ! if (ex is WrongClassException) ! { ! return new HibernateObjectRetrievalFailureException((WrongClassException) ex); ! } ! if (ex is StaleObjectStateException) ! { ! return new HibernateOptimisticLockingFailureException((StaleObjectStateException) ex); ! } ! if (ex is QueryException) ! { ! return new HibernateQueryException((QueryException) ex); ! } ! ! if (ex is PersistentObjectException) ! { ! return new InvalidDataAccessApiUsageException(ex.Message, ex); ! } ! if (ex is TransientObjectException) ! { ! return new InvalidDataAccessApiUsageException(ex.Message, ex); ! } ! ! // fallback ! return new HibernateSystemException(ex); ! } /// <summary> *************** *** 519,522 **** --- 529,533 ---- /// <c>true</c> if [is deferred close active] [the specified session factory]; otherwise, <c>false</c>. /// </returns> + /// <exception cref="ArgumentNullException">If SessionFactory argument is null.</exception> public static bool IsDeferredCloseActive(ISessionFactory sessionFactory) { *************** *** 534,537 **** --- 545,549 ---- /// </summary> /// <param name="sessionFactory">The session factory.</param> + /// <exception cref="InvalidOperationException">If there is no session factory associated with the thread.</exception> public static void ProcessDeferredClose(ISessionFactory sessionFactory) { *************** *** 567,570 **** --- 579,583 ---- /// <param name="sessionFactory">Hibernate SessionFactory that the Criteria was created for /// (can be <code>null</code>).</param> + /// <exception cref="ArgumentNullException">If criteria argument is null.</exception> public static void ApplyTransactionTimeout(ICriteria criteria, ISessionFactory sessionFactory) { *************** *** 589,592 **** --- 602,606 ---- /// <param name="sessionFactory">Hibernate SessionFactory that the Query was created for /// (can be <code>null</code>).</param> + /// <exception cref="ArgumentNullException">If query argument is null.</exception> public static void ApplyTransactionTimeout(IQuery query, ISessionFactory sessionFactory) { *************** *** 614,617 **** --- 628,633 ---- /// <param name="sessionFactory">The session factory.</param> /// <returns>The corresponding IDbProvider, null if no mapping was found.</returns> + /// <exception cref="InvalidOperationException">If DbProviderFactory's ApplicaitonContext is not + /// an instance of IConfigurableApplicaitonContext.</exception> public static IDbProvider GetDbProvider(ISessionFactory sessionFactory) { Index: HibernateTransactionManager.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateTransactionManager.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HibernateTransactionManager.cs 30 Aug 2007 19:59:44 -0000 1.4 --- HibernateTransactionManager.cs 19 Sep 2007 22:58:22 -0000 1.5 *************** *** 135,138 **** --- 135,139 ---- /// to avoid repeated configuration and guarantee consistent behavior in transactions. /// </remarks> + /// <exception cref="InvalidOperationException">If object factory is null and need to get entity interceptor via object name.</exception> public IInterceptor EntityInterceptor { *************** *** 858,862 **** /// </p> /// </remarks> ! /// <exception cref="System.Exception"> /// In the event of misconfiguration (such as the failure to set a /// required property) or if initialization fails. --- 859,863 ---- /// </p> /// </remarks> ! /// <exception cref="System.ArgumentException"> /// In the event of misconfiguration (such as the failure to set a /// required property) or if initialization fails. Index: HibernateTemplate.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/HibernateTemplate.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HibernateTemplate.cs 31 May 2007 20:25:13 -0000 1.1 --- HibernateTemplate.cs 19 Sep 2007 22:58:22 -0000 1.2 *************** *** 224,227 **** --- 224,228 ---- /// </remarks> /// <value>The interceptor.</value> + /// <exception cref="InvalidOperationException">If object factory is not set and need to retrieve entity interceptor by name.</exception> public override IInterceptor EntityInterceptor { *************** *** 344,347 **** --- 345,349 ---- /// </p> /// </remarks> + /// <value>The name of the entity interceptor in the object factory/application context.</value> public override string EntityInterceptorObjectName { *************** *** 355,358 **** --- 357,361 ---- /// Set the object factory instance. /// </summary> + /// <value>The object factory instance</value> public override IObjectFactory ObjectFactory { *************** *** 457,460 **** --- 460,464 ---- /// to rely on auto-flushing at transaction completion. /// </remarks> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Flush() { *************** *** 475,478 **** --- 479,483 ---- /// <param name="id">An identifier of the persistent instance.</param> /// <returns>The persistent instance, or <code>null</code> if not found</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object Get(Type entityType, object id) { *************** *** 489,492 **** --- 494,499 ---- /// <param name="lockMode">The lock mode.</param> /// the persistent instance, or <code>null</code> if not found + /// <returns>the persistent instance, or null if not found</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object Get(Type type, object id, LockMode lockMode) { *************** *** 502,505 **** --- 509,514 ---- /// <param name="id">An identifier of the persistent instance.</param> /// <returns>The persistent instance</returns> + /// <exception cref="ObjectRetrievalFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object Load(Type entityType, object id) { *************** *** 516,519 **** --- 525,530 ---- /// <param name="lockMode">The lock mode.</param> /// <returns>The persistent instance</returns> + /// <exception cref="ObjectRetrievalFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object Load(Type entityType, object id, LockMode lockMode) { *************** *** 528,531 **** --- 539,544 ---- /// <param name="entity">Entity the object (of the target class) to load into.</param> /// <param name="id">An identifier of the persistent instance.</param> + /// <exception cref="ObjectRetrievalFailureException">If object not found.</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Load(object entity, object id) { *************** *** 539,542 **** --- 552,556 ---- /// <param name="entityType">Type of the entity.</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList LoadAll(Type entityType) { *************** *** 548,551 **** --- 562,566 ---- /// </summary> /// <param name="entity">The persistent instance to re-read.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Refresh(object entity) { *************** *** 559,562 **** --- 574,578 ---- /// <param name="entity">The persistent instance to re-read.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Refresh(object entity, LockMode lockMode) { *************** *** 571,574 **** --- 587,592 ---- /// <param name="entity">The he persistent instance to lock.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="ObjectOptimisticLockingFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Lock(object entity, LockMode lockMode) { *************** *** 581,584 **** --- 599,603 ---- /// <param name="entity">The transient instance to persist.</param> /// <returns>The generated identifier.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object Save(object entity) { *************** *** 591,594 **** --- 610,614 ---- /// <param name="entity">The transient instance to persist.</param> /// <param name="id">The identifier to assign.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Save(object entity, object id) { *************** *** 600,603 **** --- 620,624 ---- /// </summary> /// <param name="entity">The persistent instance to update.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Update(object entity) { *************** *** 613,616 **** --- 634,638 ---- /// <param name="entity">The persistent instance to update.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Update(object entity, LockMode lockMode) { *************** *** 624,627 **** --- 646,650 ---- /// <param name="entity">Tthe persistent instance to save or update /// (to be associated with the Hibernate Session).</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void SaveOrUpdate(object entity) { *************** *** 635,638 **** --- 658,662 ---- /// <param name="entities">Tthe persistent instances to save or update /// (to be associated with the Hibernate Session)he entities.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void SaveOrUpdateAll(ICollection entities) { *************** *** 651,654 **** --- 675,679 ---- /// <returns>The actually associated persistent object. /// (either an already loaded instance with the same id, or the given object)</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object SaveOrUpdateCopy(object entity) { *************** *** 675,678 **** --- 700,704 ---- /// <c>true</c> if session cache contains the specified entity; otherwise, <c>false</c>. /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public bool Contains(object entity) { *************** *** 684,687 **** --- 710,714 ---- /// </summary> /// <param name="entity">The persistent instance to evict.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Evict(object entity) { *************** *** 691,698 **** --- 718,727 ---- + /// <summary> /// Delete the given persistent instance. /// </summary> /// <param name="entity">The persistent instance to delete.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Delete(object entity) { *************** *** 700,706 **** --- 729,738 ---- } + /// <summary> /// Delete the given persistent instance. /// </summary> + /// <param name="entity">Tthe persistent instance to delete.</param> + /// <param name="lockMode">The lock mode to obtain.</param> /// <remarks> /// Obtains the specified lock mode if the instance exists, implicitly *************** *** 708,713 **** /// (throwing an OptimisticLockingFailureException if not found). /// </remarks> ! /// <param name="entity">Tthe persistent instance to delete.</param> ! /// <param name="lockMode">The lock mode to obtain.</param> public void Delete(object entity, LockMode lockMode) { --- 740,744 ---- /// (throwing an OptimisticLockingFailureException if not found). /// </remarks> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Delete(object entity, LockMode lockMode) { *************** *** 720,723 **** --- 751,755 ---- /// <param name="queryString">a query expressed in Hibernate's query language.</param> /// <returns>The number of entity instances deleted.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public int Delete(string queryString) { *************** *** 732,735 **** --- 764,768 ---- /// <param name="type">The Hibernate type of the parameter (or <code>null</code>).</param> /// <returns>The number of entity instances deleted.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public int Delete(string queryString, object value, IType type) { *************** *** 744,747 **** --- 777,782 ---- /// <param name="types"> Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>The number of entity instances deleted.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If length for argument values and types are not equal.</exception> public int Delete(String queryString, Object[] values, IType[] types) { *************** *** 754,765 **** } /// <summary> /// Delete all given persistent instances. /// </summary> /// <remarks> /// This can be combined with any of the find methods to delete by query /// in two lines of code, similar to Session's delete by query methods. /// </remarks> ! /// <param name="entities">The persistent instances to delete.</param> public void DeleteAll(ICollection entities) { --- 789,802 ---- } + /// <summary> /// Delete all given persistent instances. /// </summary> + /// <param name="entities">The persistent instances to delete.</param> /// <remarks> /// This can be combined with any of the find methods to delete by query /// in two lines of code, similar to Session's delete by query methods. /// </remarks> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void DeleteAll(ICollection entities) { *************** *** 785,788 **** --- 822,826 ---- /// <returns>a result object returned by the action, or <code>null</code> /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object Execute(HibernateDelegate del) { *************** *** 822,825 **** --- 860,864 ---- /// </p> /// </remarks> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object Execute(IHibernateCallback action) { *************** *** 835,839 **** /// </remarks> /// <param name="action">The calback object that specifies the Hibernate action.</param> ! /// <returns></returns> public IList ExecuteFind(IHibernateCallback action) { --- 874,880 ---- /// </remarks> /// <param name="action">The calback object that specifies the Hibernate action.</param> ! /// <returns>A IList returned by the action, or null ! /// </returns> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList ExecuteFind(IHibernateCallback action) { *************** *** 936,939 **** --- 977,981 ---- /// a List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList Find(string queryString) { *************** *** 950,953 **** --- 992,996 ---- /// a List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList Find(string queryString, object value) { *************** *** 965,968 **** --- 1008,1012 ---- /// a List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList Find(string queryString, object value, IType type) { *************** *** 977,980 **** --- 1021,1025 ---- /// <param name="values">the values of the parameters</param> /// <returns>a List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList Find(string queryString, object[] values) { *************** *** 992,995 **** --- 1037,1042 ---- /// a List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentException">If values and types are not null and their lengths are not equal</exception> public IList Find(string queryString, object[] values, IType[] types) { *************** *** 1009,1012 **** --- 1056,1060 ---- /// <param name="value">The value of the parameter</param> /// <returns>a List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedParam(string queryName, string paramName, object value) { *************** *** 1023,1026 **** --- 1071,1075 ---- /// <param name="type">Hibernate type of the parameter (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedParam(string queryName, string paramName, object value, IType type) { *************** *** 1036,1039 **** --- 1085,1089 ---- /// <param name="values">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedParam(string queryString, string[] paramNames, object[] values) { *************** *** 1050,1053 **** --- 1100,1106 ---- /// <param name="types">Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If paramNames length is not equal to values length or + /// if paramNames length is not equal to types length (when types is not null)</exception> public IList FindByNamedParam(string queryString, string[] paramNames, object[] values, IType[] types) { *************** *** 1061,1065 **** } ! return (IList)Execute(new FindByNamedParamHibernateCallback(this, queryString, paramNames, values, types),true); } --- 1114,1118 ---- } ! return (IList)Execute(new FindByNamedParamHibernateCallback(this, queryString, paramNames, values, types),true); } *************** *** 1071,1074 **** --- 1124,1128 ---- /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedQuery(string queryName) { *************** *** 1084,1087 **** --- 1138,1142 ---- /// <param name="value">The value of the parameter</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedQuery(string queryName, object value) { *************** *** 1098,1101 **** --- 1153,1157 ---- /// <param name="type">Hibernate type of the parameter (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedQuery(string queryName, object value, IType type) { *************** *** 1111,1114 **** --- 1167,1171 ---- /// <param name="values">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedQuery(string queryName, object[] values) { *************** *** 1125,1128 **** --- 1182,1187 ---- /// <param name="types">Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If values and types are not null and their lengths differ.</exception> public IList FindByNamedQuery(string queryName, object[] values, IType[] types) { *************** *** 1145,1148 **** --- 1204,1208 ---- /// <param name="value">The value of the parameter</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedQueryAndNamedParam(string queryName, string paramName, object value) { *************** *** 1177,1180 **** --- 1237,1241 ---- /// <param name="values">The values of the parameters.</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedQueryAndNamedParam(string queryName, string[] paramNames, object[] values) { *************** *** 1193,1196 **** --- 1254,1260 ---- /// <param name="types">Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If paramNames length is not equal to values length or + /// if paramNames length is not equal to types length (when types is not null)</exception> public IList FindByNamedQueryAndNamedParam(string queryName, string[] paramNames, object[] values, IType[] types) { *************** *** 1199,1203 **** throw new ArgumentOutOfRangeException("paramNames","Length of paramNames array must match length of values array"); } ! if (values != null && types != null && paramNames.Length != types.Length) { throw new ArgumentOutOfRangeException("paramNams","Length of paramNames array must match length of types array"); --- 1263,1267 ---- throw new ArgumentOutOfRangeException("paramNames","Length of paramNames array must match length of values array"); } ! if (paramNames != null && types != null && paramNames.Length != types.Length) { throw new ArgumentOutOfRangeException("paramNams","Length of paramNames array must match length of types array"); *************** *** 1215,1218 **** --- 1279,1283 ---- /// <param name="valueObject">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByNamedQueryAndValueObject(string queryName, object valueObject) { *************** *** 1228,1235 **** /// <param name="valueObject">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> public IList FindByValueObject(string queryString, object valueObject) { return (IList)Execute(new FindByValueObjectHibernateCallback(this, queryString, valueObject), true); - } --- 1293,1300 ---- /// <param name="valueObject">The values of the parameters</param> /// <returns>A List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList FindByValueObject(string queryString, object valueObject) { return (IList)Execute(new FindByValueObjectHibernateCallback(this, queryString, valueObject), true); } *************** *** 1244,1247 **** --- 1309,1313 ---- /// </summary> /// <param name="session">The session.</param> + /// <returns>The session proxy.</returns> public virtual ISession CreateSessionProxy(ISession session) { *************** *** 1272,1275 **** --- 1338,1343 ---- /// </remarks> /// <param name="session">The current Hibernate session.</param> + /// <exception cref="InvalidDataAccessApiUsageException">If write operation is attempted in read-only mode + /// </exception> public virtual void CheckWriteOperationAllowed(ISession session) { *************** *** 1504,1508 **** IQuery queryObject = session.CreateQuery(queryString); outer.PrepareQuery(queryObject); - if (values != null) { --- 1572,1575 ---- |
From: Mark P. <mar...@us...> - 2007-09-19 22:58:15
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12270 Modified Files: HibernateAccessor.cs LocalSessionFactoryObject.cs SpringSessionContext.cs Log Message: SPRNET-729 - Improve API documentation in NHibernate12 project using comment-checker program SPRNET-728 - Add missing ExecuteFind<T> method on IHibernateOperations interface Index: HibernateAccessor.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/HibernateAccessor.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** HibernateAccessor.cs 7 Aug 2007 18:55:34 -0000 1.5 --- HibernateAccessor.cs 19 Sep 2007 22:58:11 -0000 1.6 *************** *** 188,191 **** --- 188,192 ---- /// </p> /// </remarks> + /// <value>The name of the entity interceptor in the object factory/application context.</value> public abstract string EntityInterceptorObjectName { *************** *** 207,210 **** --- 208,212 ---- /// Set the object factory instance. /// </summary> + /// <value>The object factory instance.</value> public abstract IObjectFactory ObjectFactory { *************** *** 636,639 **** --- 638,642 ---- /// Ensure SessionFactory is not null /// </summary> + /// <exception cref="ArgumentException">If SessionFactory property is null.</exception> public virtual void AfterPropertiesSet() { Index: LocalSessionFactoryObject.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/LocalSessionFactoryObject.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LocalSessionFactoryObject.cs 8 Aug 2007 17:47:26 -0000 1.6 --- LocalSessionFactoryObject.cs 19 Sep 2007 22:58:11 -0000 1.7 *************** *** 194,197 **** --- 194,198 ---- /// Return the singleon session factory. /// </summary> + /// <returns>The singleon session factory.</returns> public object GetObject() { *************** *** 304,307 **** --- 305,309 ---- /// </p> /// </remarks> + /// <returns>The configuration instance.</returns> protected virtual Configuration NewConfiguration() { *************** *** 330,333 **** --- 332,336 ---- /// </p> /// </remarks> + /// <returns>The ISessionFactory instance.</returns> protected virtual ISessionFactory NewSessionFactory(Configuration config) { Index: SpringSessionContext.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/SpringSessionContext.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SpringSessionContext.cs 1 Jun 2007 02:34:12 -0000 1.1 --- SpringSessionContext.cs 19 Sep 2007 22:58:11 -0000 1.2 *************** *** 59,63 **** /// Retrieve the Spring-managed Session for the current thread. /// </summary> ! /// <returns></returns> public ISession CurrentSession() { --- 59,64 ---- /// Retrieve the Spring-managed Session for the current thread. /// </summary> ! /// <returns>Current session associated with the thread</returns> ! /// <exception cref="HibernateException">On errors retrieving thread bound session.</exception> public ISession CurrentSession() { |
From: Mark P. <mar...@us...> - 2007-09-19 22:58:14
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/Generic In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv12270/Generic Modified Files: FindHibernateDelegate.cs HibernateDaoSupport.cs HibernateDelegate.cs HibernateTemplate.cs IFindHibernateCallback.cs IHibernateCallback.cs IHibernateOperations.cs Log Message: SPRNET-729 - Improve API documentation in NHibernate12 project using comment-checker program SPRNET-728 - Add missing ExecuteFind<T> method on IHibernateOperations interface Index: IHibernateCallback.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/Generic/IHibernateCallback.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IHibernateCallback.cs 1 Jun 2007 02:34:12 -0000 1.1 --- IHibernateCallback.cs 19 Sep 2007 22:58:10 -0000 1.2 *************** *** 30,33 **** --- 30,34 ---- /// Callback interface (Generic version) for NHibernate code. /// </summary> + /// <typeparam name="T">The type of result object</typeparam> /// <remarks>To be used with HibernateTemplate execute /// method. The typical implementation will call *************** *** 52,55 **** --- 53,58 ---- /// </p> /// </remarks> + /// <returns>A result object.</returns> + /// <param name="session">The active Hibernate session</param> T DoInHibernate(ISession session); } Index: IFindHibernateCallback.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/Generic/IFindHibernateCallback.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IFindHibernateCallback.cs 1 Jun 2007 02:34:12 -0000 1.1 --- IFindHibernateCallback.cs 19 Sep 2007 22:58:10 -0000 1.2 *************** *** 28,31 **** --- 28,32 ---- /// returns a List of objects. /// </summary> + /// <typeparam name="T">The type of result object</typeparam> /// <remarks>To be used with HibernateTemplate execute /// method. The typical implementation will call *************** *** 50,53 **** --- 51,55 ---- /// </p> /// </remarks> + /// <returns>Collection result object.</returns> IList<T> DoInHibernate(ISession session); } Index: IHibernateOperations.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/Generic/IHibernateOperations.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IHibernateOperations.cs 1 Jun 2007 02:34:12 -0000 1.1 --- IHibernateOperations.cs 19 Sep 2007 22:58:10 -0000 1.2 *************** *** 19,25 **** --- 19,27 ---- #endregion + using System; using System.Collections.Generic; using NHibernate; using NHibernate.Type; + using Spring.Dao; namespace Spring.Data.NHibernate.Generic *************** *** 36,39 **** --- 38,42 ---- /// </p> /// </remarks> + /// <threadsafety statis="true" instance="true"/> /// <author>Sree Nivask (.NET)</author> /// <author>Mark Pollack (.NET)</author> *************** *** 44,53 **** /// <summary> /// Return the persistent instance of the given entity type ! /// with the given identifier, or null if not found. /// Obtains the specified lock mode if the instance exists. /// </summary> /// <param name="id">The id of the object to get.</param> ! /// <returns>the persistent instance, or null if not found</returns> ! /// T Get<T>(object id); --- 47,57 ---- /// <summary> /// Return the persistent instance of the given entity type ! /// with the given identifier, or <see langword="null" /> if not found. /// Obtains the specified lock mode if the instance exists. /// </summary> + /// <typeparam name="T">The object type to get.</typeparam> /// <param name="id">The id of the object to get.</param> ! /// <returns>the persistent instance, or <see langword="null" /> if not found</returns> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> T Get<T>(object id); *************** *** 57,63 **** --- 61,69 ---- /// Obtains the specified lock mode if the instance exists. /// </summary> + /// <typeparam name="T">The object type to get.</typeparam> /// <param name="id">The lock mode to obtain.</param> /// <param name="lockMode">The lock mode.</param> /// <returns>the persistent instance, or null if not found</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> T Get<T>(object id, LockMode lockMode); *************** *** 66,71 **** --- 72,80 ---- /// with the given identifier, throwing an exception if not found. /// </summary> + /// <typeparam name="T">The object type to load.</typeparam> /// <param name="id">An identifier of the persistent instance.</param> /// <returns>The persistent instance</returns> + /// <exception cref="ObjectRetrievalFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> T Load<T>(object id); *************** *** 75,81 **** --- 84,93 ---- /// Obtains the specified lock mode if the instance exists. /// </summary> + /// <typeparam name="T">The object type to load.</typeparam> /// <param name="id">An identifier of the persistent instance.</param> /// <param name="lockMode">The lock mode.</param> /// <returns>The persistent instance</returns> + /// <exception cref="ObjectRetrievalFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> T Load<T>(object id, LockMode lockMode); *************** *** 84,88 **** --- 96,102 ---- /// Note: Use queries or criteria for retrieving a specific subset. /// </summary> + /// <typeparam name="T">The object type to load.</typeparam> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> LoadAll<T>(); *************** *** 90,97 **** --- 104,113 ---- /// Execute a query for persistent instances. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <returns> /// a generic List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> Find<T>(string queryString); *************** *** 100,103 **** --- 116,120 ---- /// one value to a "?" parameter in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <param name="value">the value of the parameter</param> *************** *** 105,108 **** --- 122,126 ---- /// a generic List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> Find<T>(string queryString, object value); *************** *** 111,114 **** --- 129,133 ---- /// to a "?" parameter of the given type in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <param name="value">The value of the parameter.</param> *************** *** 117,120 **** --- 136,140 ---- /// a generic List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> Find<T>(string queryString, object value, IType type); *************** *** 123,129 **** --- 143,151 ---- /// number of values to "?" parameters in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <param name="values">the values of the parameters</param> /// <returns>a generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> Find<T>(string queryString, object[] values); *************** *** 132,135 **** --- 154,158 ---- /// values to "?" parameters of the given types in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">A query expressed in Hibernate's query language</param> /// <param name="values">The values of the parameters</param> *************** *** 138,141 **** --- 161,166 ---- /// a generic List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentException">If values and types are not null and their lenths are not equal</exception> IList<T> Find<T>(string queryString, object[] values, IType[] types); *************** *** 144,151 **** --- 169,178 ---- /// one value to a named parameter in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramName">The name of the parameter</param> /// <param name="value">The value of the parameter</param> /// <returns>a generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedParam<T>(string queryName, string paramName, object value); *************** *** 154,157 **** --- 181,185 ---- /// one value to a named parameter in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramName">The name of the parameter</param> *************** *** 159,162 **** --- 187,191 ---- /// <param name="type">Hibernate type of the parameter (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedParam<T>(string queryName, string paramName, object value, IType type); *************** *** 165,172 **** --- 194,203 ---- /// number of values to named parameters in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">A query expressed in Hibernate's query language</param> /// <param name="paramNames">The names of the parameters</param> /// <param name="values">The values of the parameters</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedParam<T>(string queryString, string[] paramNames, object[] values); *************** *** 175,178 **** --- 206,210 ---- /// number of values to named parameters in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">A query expressed in Hibernate's query language</param> /// <param name="paramNames">The names of the parameters</param> *************** *** 180,183 **** --- 212,218 ---- /// <param name="types">Hibernate types of the parameters (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If paramNames length is not equal to values length or + /// if paramNames length is not equal to types length (when types is not null)</exception> IList<T> FindByNamedParam<T>(string queryString, string[] paramNames, object[] values, IType[] types); *************** *** 186,191 **** --- 221,228 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedQuery<T>(string queryName); *************** *** 195,201 **** --- 232,240 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="value">The value of the parameter</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedQuery<T>(string queryName, object value); *************** *** 205,212 **** --- 244,253 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="value">The value of the parameter</param> /// <param name="type">Hibernate type of the parameter (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedQuery<T>(string queryName, object value, IType type); *************** *** 216,222 **** --- 257,265 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="values">The values of the parameters</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedQuery<T>(string queryName, object[] values); *************** *** 226,233 **** --- 269,279 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="values">The values of the parameters</param> /// <param name="types">Hibernate types of the parameters (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If values and types are not null and their lengths differ.</exception> IList<T> FindByNamedQuery<T>(string queryName, object[] values, IType[] types); *************** *** 237,244 **** --- 283,292 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramName">Name of the parameter</param> /// <param name="value">The value of the parameter</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedQueryAndNamedParam<T>(string queryName, string paramName, object value); *************** *** 248,251 **** --- 296,300 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramName">Name of the parameter</param> *************** *** 253,256 **** --- 302,306 ---- /// <param name="type">The Hibernate type of the parameter (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedQueryAndNamedParam<T>(string queryName, string paramName, object value, IType type); *************** *** 260,267 **** --- 310,319 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramNames">The names of the parameters</param> /// <param name="values">The values of the parameters.</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedQueryAndNamedParam<T>(string queryName, string[] paramNames, object[] values); *************** *** 271,274 **** --- 323,327 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramNames">The names of the parameters</param> *************** *** 276,279 **** --- 329,335 ---- /// <param name="types">Hibernate types of the parameters (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If paramNames length is not equal to values length or + /// if paramNames length is not equal to types length (when types is not null)</exception> IList<T> FindByNamedQueryAndNamedParam<T>(string queryName, string[] paramNames, object[] values, IType[] types); *************** *** 283,289 **** --- 339,347 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="valueObject">The values of the parameters</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByNamedQueryAndValueObject<T>(string queryName, object valueObject); *************** *** 292,298 **** --- 350,358 ---- /// of the given object to <i>named</i> parameters in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">A query expressed in Hibernate's query language</param> /// <param name="valueObject">The values of the parameters</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> FindByValueObject<T>(string queryString, object valueObject); *************** *** 310,316 **** --- 370,378 ---- /// </p> /// </remarks> + /// <typeparam name="T">The object type retrieved.</typeparam> /// <param name="del">The delegate callback object that specifies the Hibernate action.</param> /// <returns>a result object returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> T Execute<T>(HibernateDelegate<T> del); *************** *** 318,321 **** --- 380,384 ---- /// Execute the action specified by the delegate within a Session. /// </summary> + /// <typeparam name="T">The object type retrieved.</typeparam> /// <param name="del">The HibernateDelegate that specifies the action /// to perform.</param> *************** *** 324,327 **** --- 387,391 ---- /// <returns>a result object returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> T Execute<T>(HibernateDelegate<T> del, bool exposeNativeSession); *************** *** 329,332 **** --- 393,397 ---- /// Execute the action specified by the given action object within a Session. /// </summary> + /// <typeparam name="T">The object type retrieved.</typeparam> /// <param name="action">The callback object that specifies the Hibernate action.</param> /// <returns> *************** *** 343,346 **** --- 408,412 ---- /// </p> /// </remarks> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> T Execute<T>(IHibernateCallback<T> action); *************** *** 348,351 **** --- 414,418 ---- /// Execute the action specified by the given action object within a Session. /// </summary> + /// <typeparam name="T">The object type retrieved.</typeparam> /// <param name="action">callback object that specifies the Hibernate action.</param> /// <param name="exposeNativeSession">if set to <c>true</c> expose the native hibernate session to *************** *** 354,357 **** --- 421,425 ---- /// a result object returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> T Execute<T>(IHibernateCallback<T> action, bool exposeNativeSession); *************** *** 369,375 **** --- 437,445 ---- /// </p> /// </remarks> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="del">The delegate callback object that specifies the Hibernate action.</param> /// <returns>A generic IList returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> ExecuteFind<T>(FindHibernateDelegate<T> del); *************** *** 377,380 **** --- 447,451 ---- /// Execute the action specified by the delegate within a Session. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="del">The FindHibernateDelegate that specifies the action /// to perform.</param> *************** *** 383,391 **** --- 454,484 ---- /// <returns>A generic IList returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> ExecuteFind<T>(FindHibernateDelegate<T> del, bool exposeNativeSession); /// <summary> + /// Execute the action specified by the given action object within a Session. + /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> + /// <param name="action">The callback object that specifies the Hibernate action.</param> + /// <returns> + /// A generic IList returned by the action, or null + /// </returns> + /// <remarks> + /// Application exceptions thrown by the action object get propagated to the + /// caller (can only be unchecked). Hibernate exceptions are transformed into + /// appropriate DAO ones. Allows for returning the result object. + /// <p>Note: Callback code is not supposed to handle transactions itself! + /// Use an appropriate transaction manager like HibernateTransactionManager. + /// Generally, callback code must not touch any Session lifecycle methods, + /// like close, disconnect, or reconnect, to let the template do its work. + /// </p> + /// </remarks> + IList<T> ExecuteFind<T>(IFindHibernateCallback<T> action); + + /// <summary> /// Execute the action specified by the given action object within a Session assuming that an IList is returned. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="action">callback object that specifies the Hibernate action.</param> /// <param name="exposeNativeSession">if set to <c>true</c> expose the native hibernate session to *************** *** 394,397 **** --- 487,491 ---- /// an IList returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> IList<T> ExecuteFind<T>(IFindHibernateCallback<T> action, bool exposeNativeSession); } Index: HibernateDaoSupport.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/Generic/HibernateDaoSupport.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HibernateDaoSupport.cs 28 Aug 2007 15:26:29 -0000 1.2 --- HibernateDaoSupport.cs 19 Sep 2007 22:58:10 -0000 1.3 *************** *** 145,148 **** --- 145,149 ---- /// </p> /// </remarks> + /// <returns>The new HibernateTemplate instance</returns> protected virtual HibernateTemplate CreateHibernateTemplate(ISessionFactory sessionFactory) { *************** *** 153,156 **** --- 154,158 ---- /// Check if the hibernate template property has been set. /// </summary> + /// <exception cref="ArgumentException">If HibernateTemplate property is null.</exception> protected override void CheckDaoConfig() { Index: HibernateDelegate.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/Generic/HibernateDelegate.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HibernateDelegate.cs 1 Jun 2007 02:34:12 -0000 1.1 --- HibernateDelegate.cs 19 Sep 2007 22:58:10 -0000 1.2 *************** *** 39,42 **** --- 39,43 ---- /// </p> /// </remarks> + /// <typeparam name="T">The type of result object</typeparam> /// <author>Sree Nivask (.NET)</author> /// <version>$Id$</version> Index: FindHibernateDelegate.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/Generic/FindHibernateDelegate.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FindHibernateDelegate.cs 1 Jun 2007 02:34:12 -0000 1.1 --- FindHibernateDelegate.cs 19 Sep 2007 22:58:10 -0000 1.2 *************** *** 40,43 **** --- 40,44 ---- /// </p> /// </remarks> + /// <typeparam name="T">The type of result object</typeparam> /// <author>Sree Nivask (.NET)</author> /// <version>$Id$</version> Index: HibernateTemplate.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate12/Data/NHibernate/Generic/HibernateTemplate.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HibernateTemplate.cs 1 Jun 2007 02:34:12 -0000 1.1 --- HibernateTemplate.cs 19 Sep 2007 22:58:10 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- using NHibernate.Type; using Spring.Aop.Framework; + using Spring.Dao; using Spring.Data.Common; using Spring.Data.Support; *************** *** 221,224 **** --- 222,226 ---- /// </p> /// </remarks> + /// <value>The name of the entity interceptor in the object factory/application context.</value> public override string EntityInterceptorObjectName { *************** *** 240,243 **** --- 242,246 ---- /// Set the object factory instance. /// </summary> + /// <value>The object factory instance</value> public override IObjectFactory ObjectFactory { *************** *** 376,383 **** --- 379,388 ---- } + /// <summary> /// Delete the given persistent instance. /// </summary> /// <param name="entity">The persistent instance to delete.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Delete(object entity) { *************** *** 385,391 **** --- 390,399 ---- } + /// <summary> /// Delete the given persistent instance. /// </summary> + /// <param name="entity">Tthe persistent instance to delete.</param> + /// <param name="lockMode">The lock mode to obtain.</param> /// <remarks> /// Obtains the specified lock mode if the instance exists, implicitly *************** *** 393,398 **** /// (throwing an OptimisticLockingFailureException if not found). /// </remarks> ! /// <param name="entity">The persistent instance to delete.</param> ! /// <param name="lockMode">The lock mode to obtain.</param> public void Delete(object entity, LockMode lockMode) { --- 401,405 ---- /// (throwing an OptimisticLockingFailureException if not found). /// </remarks> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Delete(object entity, LockMode lockMode) { *************** *** 405,408 **** --- 412,416 ---- /// <param name="queryString">a query expressed in Hibernate's query language.</param> /// <returns>The number of entity instances deleted.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public int Delete(string queryString) { *************** *** 417,420 **** --- 425,429 ---- /// <param name="type">The Hibernate type of the parameter (or <code>null</code>).</param> /// <returns>The number of entity instances deleted.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public int Delete(string queryString, object value, IType type) { *************** *** 429,432 **** --- 438,442 ---- /// <param name="types"> Hibernate types of the parameters (or <code>null</code>)</param> /// <returns>The number of entity instances deleted.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public int Delete(string queryString, object[] values, IType[] types) { *************** *** 442,445 **** --- 452,456 ---- /// to rely on auto-flushing at transaction completion. /// </remarks> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Flush() { *************** *** 453,456 **** --- 464,469 ---- /// <param name="entity">Entity the object (of the target class) to load into.</param> /// <param name="id">An identifier of the persistent instance.</param> + /// <exception cref="ObjectRetrievalFailureException">If object not found.</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Load(object entity, object id) { *************** *** 462,465 **** --- 475,479 ---- /// </summary> /// <param name="entity">The persistent instance to re-read.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Refresh(object entity) { *************** *** 473,476 **** --- 487,491 ---- /// <param name="entity">The persistent instance to re-read.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Refresh(object entity, LockMode lockMode) { *************** *** 485,488 **** --- 500,504 ---- /// <c>true</c> if session cache contains the specified entity; otherwise, <c>false</c>. /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public bool Contains(object entity) { *************** *** 494,497 **** --- 510,514 ---- /// </summary> /// <param name="entity">The persistent instance to evict.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Evict(object entity) { *************** *** 506,509 **** --- 523,528 ---- /// <param name="entity">The he persistent instance to lock.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="ObjectOptimisticLockingFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Lock(object entity, LockMode lockMode) { *************** *** 516,519 **** --- 535,539 ---- /// <param name="entity">The transient instance to persist.</param> /// <returns>The generated identifier.</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object Save(object entity) { *************** *** 526,529 **** --- 546,550 ---- /// <param name="entity">The transient instance to persist.</param> /// <param name="id">The identifier to assign.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Save(object entity, object id) { *************** *** 535,538 **** --- 556,560 ---- /// </summary> /// <param name="entity">The persistent instance to update.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Update(object entity) { *************** *** 548,551 **** --- 570,574 ---- /// <param name="entity">The persistent instance to update.</param> /// <param name="lockMode">The lock mode to obtain.</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void Update(object entity, LockMode lockMode) { *************** *** 559,562 **** --- 582,586 ---- /// <param name="entity">Tthe persistent instance to save or update /// (to be associated with the Hibernate Session).</param> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public void SaveOrUpdate(object entity) { *************** *** 575,578 **** --- 599,603 ---- /// <returns>The actually associated persistent object. /// (either an already loaded instance with the same id, or the given object)</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public object SaveOrUpdateCopy(object entity) { *************** *** 589,595 **** /// Obtains the specified lock mode if the instance exists. /// </summary> /// <param name="id">The id of the object to get.</param> /// <returns>the persistent instance, or null if not found</returns> ! /// public T Get<T>(object id) { --- 614,621 ---- /// Obtains the specified lock mode if the instance exists. /// </summary> + /// <typeparam name="T">The object type to get.</typeparam> /// <param name="id">The id of the object to get.</param> /// <returns>the persistent instance, or null if not found</returns> ! /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public T Get<T>(object id) { *************** *** 602,608 **** --- 628,636 ---- /// Obtains the specified lock mode if the instance exists. /// </summary> + /// <typeparam name="T">The object type to get.</typeparam> /// <param name="id">The lock mode to obtain.</param> /// <param name="lockMode">The lock mode.</param> /// <returns>the persistent instance, or null if not found</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public T Get<T>(object id, LockMode lockMode) { *************** *** 618,623 **** --- 646,654 ---- /// with the given identifier, throwing an exception if not found. /// </summary> + /// <typeparam name="T">The object type to load.</typeparam> /// <param name="id">An identifier of the persistent instance.</param> /// <returns>The persistent instance</returns> + /// <exception cref="ObjectRetrievalFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public T Load<T>(object id) { *************** *** 630,636 **** --- 661,670 ---- /// Obtains the specified lock mode if the instance exists. /// </summary> + /// <typeparam name="T">The object type to load.</typeparam> /// <param name="id">An identifier of the persistent instance.</param> /// <param name="lockMode">The lock mode.</param> /// <returns>The persistent instance</returns> + /// <exception cref="ObjectRetrievalFailureException">If not found</exception> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public T Load<T>(object id, LockMode lockMode) { *************** *** 642,646 **** --- 676,682 ---- /// Note: Use queries or criteria for retrieving a specific subset. /// </summary> + /// <typeparam name="T">The object type to load.</typeparam> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> LoadAll<T>() { *************** *** 655,662 **** --- 691,700 ---- /// Execute a query for persistent instances. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <returns> /// a generic List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> Find<T>(string queryString) { *************** *** 668,671 **** --- 706,710 ---- /// one value to a "?" parameter in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <param name="value">the value of the parameter</param> *************** *** 673,676 **** --- 712,716 ---- /// a generic List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> Find<T>(string queryString, object value) { *************** *** 682,685 **** --- 722,726 ---- /// to a "?" parameter of the given type in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <param name="value">The value of the parameter.</param> *************** *** 688,691 **** --- 729,733 ---- /// a generic List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> Find<T>(string queryString, object value, IType type) { *************** *** 697,703 **** --- 739,747 ---- /// number of values to "?" parameters in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">a query expressed in Hibernate's query language</param> /// <param name="values">the values of the parameters</param> /// <returns>a generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> Find<T>(string queryString, object[] values) { *************** *** 709,712 **** --- 753,757 ---- /// values to "?" parameters of the given types in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">A query expressed in Hibernate's query language</param> /// <param name="values">The values of the parameters</param> *************** *** 715,718 **** --- 760,765 ---- /// a generic List containing 0 or more persistent instances /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentException">If values and types are not null and their lengths are not equal</exception> public IList<T> Find<T>(string queryString, object[] values, IType[] types) { *************** *** 728,735 **** --- 775,784 ---- /// one value to a named parameter in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramName">The name of the parameter</param> /// <param name="value">The value of the parameter</param> /// <returns>a generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedParam<T>(string queryName, string paramName, object value) { *************** *** 741,744 **** --- 790,794 ---- /// one value to a named parameter in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramName">The name of the parameter</param> *************** *** 746,749 **** --- 796,800 ---- /// <param name="type">Hibernate type of the parameter (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedParam<T>(string queryName, string paramName, object value, IType type) { *************** *** 755,762 **** --- 806,815 ---- /// number of values to named parameters in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">A query expressed in Hibernate's query language</param> /// <param name="paramNames">The names of the parameters</param> /// <param name="values">The values of the parameters</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedParam<T>(string queryString, string[] paramNames, object[] values) { *************** *** 768,771 **** --- 821,825 ---- /// number of values to named parameters in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">A query expressed in Hibernate's query language</param> /// <param name="paramNames">The names of the parameters</param> *************** *** 773,776 **** --- 827,833 ---- /// <param name="types">Hibernate types of the parameters (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If paramNames length is not equal to values length or + /// if paramNames length is not equal to types length (when types is not null)</exception> public IList<T> FindByNamedParam<T>(string queryString, string[] paramNames, object[] values, IType[] types) { *************** *** 794,799 **** --- 851,858 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedQuery<T>(string queryName) { *************** *** 806,812 **** --- 865,873 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="value">The value of the parameter</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedQuery<T>(string queryName, object value) { *************** *** 819,826 **** --- 880,889 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="value">The value of the parameter</param> /// <param name="type">Hibernate type of the parameter (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedQuery<T>(string queryName, object value, IType type) { *************** *** 833,839 **** --- 896,904 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="values">The values of the parameters</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedQuery<T>(string queryName, object[] values) { *************** *** 846,853 **** --- 911,921 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="values">The values of the parameters</param> /// <param name="types">Hibernate types of the parameters (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If values and types are not null and their lengths differ.</exception> public IList<T> FindByNamedQuery<T>(string queryName, object[] values, IType[] types) { *************** *** 864,871 **** --- 932,941 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramName">Name of the parameter</param> /// <param name="value">The value of the parameter</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedQueryAndNamedParam<T>(string queryName, string paramName, object value) { *************** *** 878,881 **** --- 948,952 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramName">Name of the parameter</param> *************** *** 883,886 **** --- 954,958 ---- /// <param name="type">The Hibernate type of the parameter (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedQueryAndNamedParam<T>(string queryName, string paramName, object value, IType type) { *************** *** 894,901 **** --- 966,975 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramNames">The names of the parameters</param> /// <param name="values">The values of the parameters.</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedQueryAndNamedParam<T>(string queryName, string[] paramNames, object[] values) { *************** *** 908,911 **** --- 982,986 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="paramNames">The names of the parameters</param> *************** *** 913,916 **** --- 988,994 ---- /// <param name="types">Hibernate types of the parameters (or null)</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> + /// <exception cref="ArgumentOutOfRangeException">If paramNames length is not equal to values length or + /// if paramNames length is not equal to types length (when types is not null)</exception> public IList<T> FindByNamedQueryAndNamedParam<T>(string queryName, string[] paramNames, object[] values, IType[] types) *************** *** 921,925 **** "Length of paramNames array must match length of values array"); } ! if (values != null && types != null && paramNames.Length != types.Length) { throw new ArgumentOutOfRangeException("paramNams", --- 999,1003 ---- "Length of paramNames array must match length of values array"); } ! if (paramNames != null && types != null && paramNames.Length != types.Length) { throw new ArgumentOutOfRangeException("paramNams", *************** *** 937,943 **** --- 1015,1023 ---- /// A named query is defined in a Hibernate mapping file. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryName">The name of a Hibernate query in a mapping file</param> /// <param name="valueObject">The values of the parameters</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByNamedQueryAndValueObject<T>(string queryName, object valueObject) { *************** *** 950,956 **** --- 1030,1038 ---- /// of the given object to <i>named</i> parameters in the query string. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="queryString">A query expressed in Hibernate's query language</param> /// <param name="valueObject">The values of the parameters</param> /// <returns>A generic List containing 0 or more persistent instances</returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> FindByValueObject<T>(string queryString, object valueObject) { *************** *** 975,981 **** --- 1057,1065 ---- /// </p> /// </remarks> + /// <typeparam name="T">The object type retrieved.</typeparam> /// <param name="del">The delegate callback object that specifies the Hibernate action.</param> /// <returns>a result object returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public T Execute<T>(HibernateDelegate<T> del) { *************** *** 986,989 **** --- 1070,1074 ---- /// Execute the action specified by the delegate within a Session. /// </summary> + /// <typeparam name="T">The object type retrieved.</typeparam> /// <param name="del">The HibernateDelegate that specifies the action /// to perform.</param> *************** *** 992,995 **** --- 1077,1081 ---- /// <returns>a result object returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public T Execute<T>(HibernateDelegate<T> del, bool exposeNativeSession) { *************** *** 1000,1003 **** --- 1086,1090 ---- /// Execute the action specified by the given action object within a Session. /// </summary> + /// <typeparam name="T">The object type retrieved.</typeparam> /// <param name="action">The callback object that specifies the Hibernate action.</param> /// <returns> *************** *** 1014,1017 **** --- 1101,1105 ---- /// </p> /// </remarks> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public T Execute<T>(IHibernateCallback<T> action) { *************** *** 1022,1025 **** --- 1110,1114 ---- /// Execute the action specified by the given action object within a Session. /// </summary> + /// <typeparam name="T">The object type retrieved.</typeparam> /// <param name="action">callback object that specifies the Hibernate action.</param> /// <param name="exposeNativeSession">if set to <c>true</c> expose the native hibernate session to *************** *** 1028,1031 **** --- 1117,1121 ---- /// a result object returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public T Execute<T>(IHibernateCallback<T> action, bool exposeNativeSession) { *************** *** 1097,1100 **** --- 1187,1191 ---- /// Execute the action specified by the given action object within a Session assuming that an IList is returned. /// </summary> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="action">callback object that specifies the Hibernate action.</param> /// <param name="exposeNativeSession">if set to <c>true</c> expose the native hibernate session to *************** *** 1103,1106 **** --- 1194,1198 ---- /// an IList returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</exception> public IList<T> ExecuteFind<T>(IFindHibernateCallback<T> action, bool exposeNativeSession) { *************** *** 1177,1183 **** --- 1269,1277 ---- /// </p> /// </remarks> + /// <typeparam name="T">The object type to find.</typeparam> /// <param name="del">The delegate callback object that specifies the Hibernate action.</param> /// <returns>A generic IList returned by the action, or null /// </returns> + /// <exception cref="DataAccessException">In case of Hibernate errors</ex... [truncated message content] |
From: Mark P. <mar...@us...> - 2007-09-19 21:24:51
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7507 Modified Files: ado.xml Log Message: fix example using generic query with row mapper Index: ado.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/ado.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ado.xml 9 Aug 2007 06:30:17 -0000 1.15 --- ado.xml 19 Sep 2007 21:24:44 -0000 1.16 *************** *** 541,545 **** <sect2 id="ado-execute-callback-net11"> ! > <title>Execute Callback in .NET 1.1</title> --- 541,545 ---- <sect2 id="ado-execute-callback-net11"> ! > <title>Execute Callback in .NET 1.1</title> *************** *** 1271,1275 **** public virtual IList<Customer> GetCustomers() { ! return AdoTemplate.QueryWithRowMapper(CommandType.Text, cmdText, new CustomerRowMapper<Customer>()); } --- 1271,1275 ---- public virtual IList<Customer> GetCustomers() { ! return AdoTemplate.QueryWithRowMapper<Customer>(CommandType.Text, cmdText, new CustomerRowMapper<Customer>()); } |