From: <fab...@us...> - 2008-10-10 12:31:21
|
Revision: 3830 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3830&view=rev Author: fabiomaulo Date: 2008-10-10 12:31:10 +0000 (Fri, 10 Oct 2008) Log Message: ----------- Added methods to work with entity-name to ISession Possible Breaking change: - see ISession Modified Paths: -------------- trunk/nhibernate/releasenotes.txt trunk/nhibernate/src/NHibernate/ISession.cs trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs trunk/nhibernate/src/NHibernate.sln Modified: trunk/nhibernate/releasenotes.txt =================================================================== --- trunk/nhibernate/releasenotes.txt 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/releasenotes.txt 2008-10-10 12:31:10 UTC (rev 3830) @@ -1,3 +1,9 @@ +Build 2.1.0.GA +======================== +** BREAKING CHANGES from NH2.0.xGA to NH2.1.0 + ##### Possible Breaking Changes for external frameworks ##### + * ISession interface have additional methods + Build 2.0.1.GA ======================== ** Bug Modified: trunk/nhibernate/src/NHibernate/ISession.cs =================================================================== --- trunk/nhibernate/src/NHibernate/ISession.cs 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/src/NHibernate/ISession.cs 2008-10-10 12:31:10 UTC (rev 3830) @@ -453,6 +453,17 @@ void Delete(object obj); /// <summary> + /// Remove a persistent instance from the datastore. The <b>object</b> argument may be + /// an instance associated with the receiving <see cref="ISession"/> or a transient + /// instance with an identifier associated with existing persistent state. + /// This operation cascades to associated instances if the association is mapped + /// with <tt>cascade="delete"</tt>. + /// </summary> + /// <param name="entityName">The entity name for the instance to be removed. </param> + /// <param name="obj">the instance to be removed </param> + void Delete(string entityName, object obj); + + /// <summary> /// Execute a query /// </summary> /// <param name="query">A query expressed in Hibernate's query language</param> @@ -716,8 +727,23 @@ /// <returns>An ICriteria object</returns> ICriteria CreateCriteria(System.Type persistentClass, string alias); + /// <summary> + /// Create a new <c>Criteria</c> instance, for the given entity name. + /// </summary> + /// <param name="entityName">The name of the entity to Query</param> + /// <returns>An ICriteria object</returns> + ICriteria CreateCriteria(string entityName); /// <summary> + /// Create a new <c>Criteria</c> instance, for the given entity name, + /// with the given alias. + /// </summary> + /// <param name="entityName">The name of the entity to Query</param> + /// <param name="alias">The alias of the entity</param> + /// <returns>An ICriteria object</returns> + ICriteria CreateCriteria(string entityName, string alias); + + /// <summary> /// Create a new instance of <c>Query</c> for the given query string /// </summary> /// <param name="queryString">A hibernate query string</param> Modified: trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/src/NHibernate/Impl/SessionImpl.cs 2008-10-10 12:31:10 UTC (rev 3830) @@ -1476,6 +1476,18 @@ return new CriteriaImpl(persistentClass, alias, this); } + public ICriteria CreateCriteria(string entityName, string alias) + { + CheckAndUpdateSessionStatus(); + return new CriteriaImpl(entityName, alias, this); + } + + public ICriteria CreateCriteria(string entityName) + { + CheckAndUpdateSessionStatus(); + return new CriteriaImpl(entityName, this); + } + public override IList List(CriteriaImpl criteria) { ArrayList results = new ArrayList(); Modified: trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs =================================================================== --- trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/src/NHibernate.Test/EntityModeTest/Xml/Basic/XmlFixture.cs 2008-10-10 12:31:10 UTC (rev 3830) @@ -53,10 +53,10 @@ s = OpenSession(); t = s.BeginTransaction(); - //a = (XmlElement)s.CreateCriteria("A").UniqueResult(); + a = (XmlElement)s.CreateCriteria("A").UniqueResult(); Assert.AreEqual(a.GetElementsByTagName("b").Count, 2); Print(a); - //s.Delete("A", a); + s.Delete("A", a); t.Commit(); s.Close(); } Modified: trunk/nhibernate/src/NHibernate.sln =================================================================== --- trunk/nhibernate/src/NHibernate.sln 2008-10-10 12:02:27 UTC (rev 3829) +++ trunk/nhibernate/src/NHibernate.sln 2008-10-10 12:31:10 UTC (rev 3830) @@ -3,6 +3,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{593DCEA7-C933-46F3-939F-D8172399AB05}" ProjectSection(SolutionItems) = preProject ..\default.build = ..\default.build + ..\releasenotes.txt = ..\releasenotes.txt EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NHibernate", "NHibernate\NHibernate.csproj", "{5909BFE7-93CF-4E5F-BE22-6293368AF01D}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |