Skip to content

Commit 0e591a2

Browse files
Update user types documentation
Remove reference to a suppressed user type (INullableUserType), remove obsolete documentation about mutability, cacheability and xml mode, obsolete an unused interface.
1 parent f3be548 commit 0e591a2

File tree

5 files changed

+31
-22
lines changed

5 files changed

+31
-22
lines changed

doc/reference/modules/basic_mapping.xml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3982,12 +3982,11 @@
39823982
</para>
39833983

39843984
<para>
3985-
The <literal>ICompositeUserType</literal>, <literal>IEnhancedUserType</literal>,
3986-
<literal>INullableUserType</literal>, <literal>IUserCollectionType</literal>,
3987-
and <literal>IUserVersionType</literal> interfaces provide support for more specialized
3988-
uses.
3985+
The <literal>IEnhancedUserType</literal>, <literal>IUserVersionType</literal>,
3986+
and <literal>IUserCollectionType</literal> interfaces provide support for more specialized
3987+
uses. The later is to be used with collections, see <xref linkend="collections-persistent" />.
39893988
</para>
3990-
3989+
39913990
<para>
39923991
You may even supply parameters to an <literal>IUserType</literal> in the mapping file. To
39933992
do this, your <literal>IUserType</literal> must implement the

src/NHibernate/UserTypes/ICompositeUserType.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@ namespace NHibernate.UserTypes
99
/// A UserType that may be dereferenced in a query.
1010
/// This interface allows a custom type to define "properties".
1111
/// These need not necessarily correspond to physical .NET style properties.
12-
///
13-
/// A ICompositeUserType may be used in almost every way
12+
/// </summary>
13+
/// <remarks>
14+
/// <para>
15+
/// An <c>ICompositeUserType</c> may be used in almost every way
1416
/// that a component may be used. It may even contain many-to-one
1517
/// associations.
16-
///
17-
/// Implementors must be immutable and must declare a public
18-
/// default constructor.
19-
///
20-
/// Unlike UserType, cacheability does not depend upon
21-
/// serializability. Instead, Assemble() and
22-
/// Disassemble() provide conversion to/from a cacheable
18+
/// </para>
19+
/// <para>
20+
/// Implementors must declare a public default constructor.
21+
/// </para>
22+
/// <para>
23+
/// For ensuring cacheability, <see cref="Assemble" /> and
24+
/// <see cref="Disassemble" /> must provide conversion to/from a cacheable
2325
/// representation.
24-
/// </summary>
26+
/// </para>
27+
/// </remarks>
2528
public interface ICompositeUserType
2629
{
2730
/// <summary>
@@ -135,4 +138,4 @@ public interface ICompositeUserType
135138
/// </summary>
136139
object Replace(object original, object target, ISessionImplementor session, object owner);
137140
}
138-
}
141+
}

src/NHibernate/UserTypes/IEnhancedUserType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace NHibernate.UserTypes
44
{
55
/// <summary>
66
/// A custom type that may function as an identifier or discriminator
7-
/// type, or may be marshalled to and from an XML document.
7+
/// type.
88
/// </summary>
99
public interface IEnhancedUserType : IUserType
1010
{

src/NHibernate/UserTypes/ILoggableUserType.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using NHibernate.Engine;
23

34
namespace NHibernate.UserTypes
@@ -6,6 +7,8 @@ namespace NHibernate.UserTypes
67
/// Marker interface for user types which want to perform custom
78
/// logging of their corresponding values
89
/// </summary>
10+
// Since 5.2
11+
[Obsolete("This interface has no usage and will be removed in a future version")]
912
public interface ILoggableUserType
1013
{
1114
/// <summary> Generate a loggable string representation of the collection (value). </summary>

src/NHibernate/UserTypes/IUserType.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@ namespace NHibernate.UserTypes
1010
/// <remarks>
1111
/// <para>
1212
/// The interface abstracts user code from future changes to the <see cref="Type.IType"/> interface,
13-
/// simplifies the implementation of custom types and hides certain "internal interfaces from
13+
/// simplifies the implementation of custom types and hides certain "internal interfaces" from
1414
/// user code.
1515
/// </para>
1616
/// <para>
17-
/// Implementers must be immutable and must declare a public default constructor.
17+
/// Implementers must declare a public default constructor.
1818
/// </para>
1919
/// <para>
20-
/// The actual class mapped by a <c>IUserType</c> may be just about anything. However, if it is to
21-
/// be cacheble by a persistent cache, it must be serializable.
20+
/// The actual class mapped by a <c>IUserType</c> may be just about anything.
21+
/// </para>
22+
/// <para>
23+
/// For ensuring cacheability, <see cref="Assemble" /> and
24+
/// <see cref="Disassemble" /> must provide conversion to/from a cacheable
25+
/// representation.
2226
/// </para>
2327
/// <para>
2428
/// Alternatively, custom types could implement <see cref="Type.IType"/> directly or extend one of the
25-
/// abstract classes in <c>NHibernate.Type</c>. This approach risks future incompatible changes
29+
/// abstract classes in <c>NHibernate.Type</c>. This approach risks more future incompatible changes
2630
/// to classes or interfaces in the package.
2731
/// </para>
2832
/// </remarks>

0 commit comments

Comments
 (0)