public static NullableType GetBinaryType(int length)
        {
            //HACK: don't understand why SerializableType calls this with length=0
            if (length == 0)
            {
                return(NHibernateUtil.Binary);
            }

            string key = GetKeyForLengthBased(NHibernateUtil.Binary.Name, length);
            IType  returnType;

            if (!typeByTypeOfName.TryGetValue(key, out returnType))
            {
                returnType = new BinaryType(SqlTypeFactory.GetBinary(length));
                AddToTypeOfNameWithLength(key, returnType);
            }

            return((NullableType)returnType);
        }
		public static NullableType GetBinaryType(int length)
		{
			//HACK: don't understand why SerializableType calls this with length=0
			if (length == 0)
			{
				return NHibernateUtil.Binary;
			}

			string key = GetKeyForLengthBased(NHibernateUtil.Binary.Name, length);
			IType returnType;
			if (!typeByTypeOfName.TryGetValue(key, out returnType))
			{
				returnType = new BinaryType(SqlTypeFactory.GetBinary(length));
				AddToTypeOfNameWithLength(key, returnType);
			}

			return (NullableType)returnType;
		}
Beispiel #3
0
 internal SerializableType(System.Type serializableClass, BinarySqlType sqlType) : base(sqlType)
 {
     this.serializableClass = serializableClass;
     binaryType             = (BinaryType)TypeFactory.GetBinaryType(sqlType.Length);
 }
Beispiel #4
0
 internal SerializableType(System.Type serializableClass) : base(new BinarySqlType())
 {
     this.serializableClass = serializableClass;
     binaryType             = (BinaryType)NHibernateUtil.Binary;
 }
		internal SerializableType( System.Type serializableClass, BinarySqlType sqlType ) : base( sqlType )
		{
			this.serializableClass = serializableClass;
			binaryType = ( BinaryType ) TypeFactory.GetBinaryType( sqlType.Length );
		}
		internal SerializableType( System.Type serializableClass ) : base( new BinarySqlType() )
		{
			this.serializableClass = serializableClass;
			this.binaryType = ( BinaryType ) NHibernateUtil.Binary;

		}