Skip to content

Commit 623d798

Browse files
Documentation fixes (#690)
* Replacing obsolete and no more existent documented methods. * Modernize/fix code examples and guidelines. * Removing obsolete default configuration: no need for proxy factory by default. * Removed references to abandoned or not ported tools. * Upgrade/fix external links. * Second level cache: transaction requirement. * Recommandation on transacting. * Update and sort dialects in configuration listing. * More alternatives to xml mapping. * Fix typo and other minor adjustments. * Fixing pdf overflows. * Fixing SHFB build by using msbuild.exe instead of dotnet.
1 parent e8be9d1 commit 623d798

32 files changed

+996
-939
lines changed

Tools/actual_msbuild.cmd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@echo off
2+
3+
for /f "usebackq tokens=*" %%i in (`%~dp0\vswhere.2.1.4\tools\vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
4+
set InstallDir=%%i
5+
)
6+
7+
if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (
8+
"%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" %*
9+
) else (
10+
exit /b -1
11+
)

Tools/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
99
<package id="NUnit.Extension.VSProjectLoader" version="3.6.0" targetFramework="net461" />
1010
<package id="CSharpAsyncGenerator.CommandLine" version="0.4.4" targetFramework="net461" />
11+
<package id="vswhere" version="2.1.4" targetFramework="net461" />
1112
</packages>

build-common/common.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<!-- This is used only for build folder -->
3737
<!-- TODO: Either remove or refactor to use NHibernate.props -->
3838
<property name="project.version" value="5.0.0-Alpha1" overwrite="false" />
39+
<property name="project.version.numeric" value="5.0.0" overwrite="false" />
3940

4041
<!-- debug|release -->
4142
<property name="build.defines" value="" />

doc/documentation.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@
6565
<echo if="${api.uptodate}">API documentation is up to date, skipping generation step.</echo>
6666

6767
<if test="${not api.uptodate}">
68-
<exec program="${path::combine(tools.dir, 'msbuild.cmd')}">
68+
<exec program="${path::combine(tools.dir, 'actual_msbuild.cmd')}">
6969
<arg line="NHibernate.shfbproj" />
7070
</exec>
7171
</if>
7272
</target>
7373

74-
</project>
74+
</project>

doc/reference/master.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
<!ENTITY nhc-preface SYSTEM "modules/nhibernatecontrib_preface.xml">
3232
<!ENTITY nhcaches-chapter SYSTEM "modules/nhibernate_caches.xml">
3333
<!ENTITY nhma-chapter SYSTEM "modules/nhibernate_mapping_attributes.xml">
34-
<!ENTITY nhbm2net-chapter SYSTEM "modules/nhibernate_tool_hbm2net.xml">
35-
<!ENTITY nullables-chapter SYSTEM "modules/nullables.xml">
3634
]>
3735

3836

doc/reference/modules/architecture.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
</mediaobject>
6565

6666
<para>
67-
Heres some definitions of the objects in the diagrams:
67+
Here are some definitions of the objects in the diagrams:
6868

6969
<variablelist spacing="compact">
7070
<varlistentry>
@@ -122,7 +122,8 @@
122122
(Optional) A single-threaded, short-lived object used by the application to
123123
specify atomic units of work. Abstracts application from underlying ADO.NET
124124
transaction. An <literal>ISession</literal> might span several
125-
<literal>ITransaction</literal>s in some cases.
125+
<literal>ITransaction</literal>s in some cases. Transaction scopes may be used
126+
instead.
126127
</para>
127128
</listitem>
128129
</varlistentry>
@@ -227,7 +228,7 @@
227228
Starting with version 1.2, NHibernate added the <literal>ISessionFactory.GetCurrentSession()</literal>
228229
method. The processing behind <literal>ISessionFactory.GetCurrentSession()</literal> is pluggable.
229230
An extension interface (<literal>NHibernate.Context.ICurrentSessionContext</literal>) and a new
230-
configuration parameter (<literal>hibernate.current_session_context_class</literal>) have been added
231+
configuration parameter (<literal>current_session_context_class</literal>) have been added
231232
to allow pluggability of the scope and context of defining current sessions.
232233
</para>
233234
<para>
@@ -245,7 +246,7 @@
245246
by current asynchronous flow. You are responsible to bind and unbind an
246247
<literal>ISession</literal> instance with static methods of class
247248
<literal>CurrentSessionContext</literal>. Binding operations from inner flows will not be
248-
propagated to outer or siblings flows.
249+
propagated to outer or siblings flows. Added in NHibernate 5.0.
249250
</para>
250251
</listitem>
251252
<listitem>
@@ -293,7 +294,7 @@
293294
</itemizedlist>
294295

295296
<para>
296-
The <literal>hibernate.current_session_context_class</literal> configuration parameter
297+
The <literal>current_session_context_class</literal> configuration parameter
297298
defines which <literal>NHibernate.Context.ICurrentSessionContext</literal> implementation
298299
should be used. Typically, the value of this parameter would just name the implementation
299300
class to use (including the assembly name); for the out-of-the-box implementations, however,

doc/reference/modules/basic_mapping.xml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
Note that, even though many NHibernate users choose to define XML mappings by hand,
1616
a number of tools exist to generate the mapping document, including
1717
NHibernate.Mapping.Attributes library and various template-based code
18-
generators (CodeSmith, MyGeneration).
18+
generators (CodeSmith, MyGeneration). You may also use
19+
<literal>NHibernate.Mapping.ByCode</literal> available since NHibernate 3.2, or
20+
<ulink url="https://github.com/jagregory/fluent-nhibernate">Fluent NHibernate</ulink>.
1921
</para>
2022

2123
<para>
@@ -614,8 +616,9 @@
614616
<listitem>
615617
<para>
616618
uses the algorithm to generate a new <literal>System.Guid</literal>
617-
described by Jimmy Nilsson in the article
618-
http://www.informit.com/articles/article.asp?p=25862.
619+
described by Jimmy Nilsson in
620+
<ulink url="https://www.informit.com/articles/article.aspx?p=25862">this
621+
article</ulink>.
619622
</para>
620623
</listitem>
621624
</varlistentry>
@@ -2929,9 +2932,10 @@
29292932
are possible.
29302933
</para>
29312934

2932-
<programlisting><![CDATA[<property name="TwoStrings" type="NHibernate.DomainModel.DoubleStringType, NHibernate.DomainModel">
2933-
<column name="first_string"/>
2934-
<column name="second_string"/>
2935+
<programlisting><![CDATA[<property name="TwoStrings"
2936+
type="NHibernate.DomainModel.DoubleStringType, NHibernate.DomainModel">
2937+
<column name="first_string"/>
2938+
<column name="second_string"/>
29352939
</property>]]></programlisting>
29362940

29372941
<para>

doc/reference/modules/batch.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ using (ITransaction tx = session.BeginTransaction())
208208
<programlisting><![CDATA[using (ISession session = sessionFactory.OpenSession())
209209
using (ITransaction tx = session.BeginTransaction())
210210
{
211-
string hqlVersionedUpdate = "update versioned Customer set name = :newName where name = :oldName";
211+
string hqlVersionedUpdate =
212+
"update versioned Customer set name = :newName where name = :oldName";
212213
int updatedEntities = s.CreateQuery(hqlUpdate)
213214
.SetString("newName", newName)
214215
.SetString("oldName", oldName)
@@ -313,7 +314,9 @@ using (ITransaction tx = session.BeginTransaction())
313314
<programlisting><![CDATA[using (ISession session = sessionFactory.OpenSession())
314315
using (ITransaction tx = session.BeginTransaction())
315316
{
316-
var hqlInsert = "insert into DelinquentAccount (id, name) select c.id, c.name from Customer c where ...";
317+
var hqlInsert =
318+
"insert into DelinquentAccount (id, name) " +
319+
"select c.id, c.name from Customer c where ...";
317320
int createdEntities = s.CreateQuery(hqlInsert)
318321
.ExecuteUpdate();
319322
tx.Commit();

0 commit comments

Comments
 (0)