Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>i would go with a user type</p> <pre><code>class UInt64UserType : ImmutableUserType { public object NullSafeGet(IDataReader rs, string[] names, object owner) { var value = NHibernateUtil.Decimal.NullSafeGet(rs, names[0]); return (value == null) ? 0 : Convert.ToUInt64(value); } public void NullSafeSet(IDbCommand cmd, object value, int index) { decimal d = Convert.ToDecimal(value); NHibernateUtil.Decimal.NullSafeSet(cmd, d, index); } public Type ReturnedType { get { return typeof(UInt64); } } public SqlType[] SqlTypes { get { return new[] { SqlTypeFactory.Decimal }; } } } .CustomType&lt;UInt64UserType&gt;() </code></pre> <p>Edit: sorry forgot to note. i have a lot of usertypes so i implemented my own baseclasses</p> <pre><code>public abstract class ImmutableUserType : UserTypeBase { public override bool IsMutable { get { return false; } } public override object DeepCopy(object value) { return value; } public override object Replace(object original, object target, object owner) { return original; } public override object Assemble(object cached, object owner) { return cached; } public override object Disassemble(object value) { return value; } } public abstract class UserTypeBase : IUserType { public new virtual bool Equals(object x, object y) { return EqualsHelper.Equals(x, y); } public virtual int GetHashCode(object x) { return (x == null) ? 0 : x.GetHashCode(); } public abstract object Assemble(object cached, object owner); public abstract object DeepCopy(object value); public abstract object Disassemble(object value); public abstract bool IsMutable { get; } public abstract object NullSafeGet(System.Data.IDataReader rs, string[] names, object owner); public abstract void NullSafeSet(System.Data.IDbCommand cmd, object value, int index); public abstract object Replace(object original, object target, object owner); public abstract Type ReturnedType { get; } public abstract SqlType[] SqlTypes { get; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload