Update of /cvsroot/nhibernate/nhibernate/src/NHibernate/Type
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5673/NHibernate/Type
Modified Files:
TypeFactory.cs
Added Files:
BinaryBlobType.cs StringClobType.cs
Log Message:
Added Types so that MsSql could make a image and ntext parameter.
Index: TypeFactory.cs
===================================================================
RCS file: /cvsroot/nhibernate/nhibernate/src/NHibernate/Type/TypeFactory.cs,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** TypeFactory.cs 21 Aug 2004 16:37:33 -0000 1.37
--- TypeFactory.cs 25 Aug 2004 03:52:21 -0000 1.38
***************
*** 77,80 ****
--- 77,82 ----
// get a Timezone by name...
//basicTypes.Add(NHibernate.Timezone.Name, NHibernate.Timezone);
+
+ // set up the mappings of .NET Classes/Structs to their NHibernate types.
typeByTypeOfName[ typeof(System.Byte[]).Name ] = NHibernate.Binary ;
typeByTypeOfName[ typeof(System.Byte[]).AssemblyQualifiedName ] = NHibernate.Binary ;
***************
*** 108,116 ****
--- 110,121 ----
typeByTypeOfName[ typeof(System.TimeSpan).AssemblyQualifiedName ] = NHibernate.TimeSpan;
+ // add the mappings of the NHibernate specific names that are used in type=""
typeByTypeOfName[ NHibernate.AnsiString.Name ] = NHibernate.AnsiString ;
typeByTypeOfName[ NHibernate.Binary.Name ] = NHibernate.Binary ;
+ typeByTypeOfName[ NHibernate.BinaryBlob.Name ] = NHibernate.BinaryBlob;
typeByTypeOfName[ NHibernate.Boolean.Name ] = NHibernate.Boolean;
typeByTypeOfName[ NHibernate.Byte.Name ] = NHibernate.Byte;
typeByTypeOfName[ NHibernate.Character.Name ] = NHibernate.Character;
+ typeByTypeOfName[ NHibernate.StringClob.Name ] = NHibernate.StringClob;
typeByTypeOfName[ NHibernate.CultureInfo.Name ] = NHibernate.CultureInfo;
typeByTypeOfName[ NHibernate.DateTime.Name ] = NHibernate.DateTime;
***************
*** 141,144 ****
--- 146,151 ----
typeByTypeOfName[ NHibernate.Serializable.Name ] = NHibernate.Serializable;
+ // object needs to have both class and serializable setup before it can
+ // be created.
typeByTypeOfName[ typeof(System.Object).FullName ] = NHibernate.Object;
typeByTypeOfName[ typeof(System.Object).AssemblyQualifiedName ] = NHibernate.Object;
***************
*** 147,151 ****
// These are in here for Hibernate mapping compatibility
typeByTypeOfName[ "binary" ] = NHibernate.Binary ;
- // TODO: add clob and blob when implemented
typeByTypeOfName[ "boolean" ] = NHibernate.Boolean;
typeByTypeOfName[ "byte" ] = NHibernate.Byte;
--- 154,157 ----
--- NEW FILE: StringClobType.cs ---
using System;
using NHibernate.SqlTypes;
namespace NHibernate.Type
{
/// <summary>
/// Maps a System.String Property to an column that can store a CLOB.
/// </summary>
/// <remarks>
/// This is only needed by DataProviders (SqlClient) that need to specify a Size for the
/// IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a StringType
/// would work just fine.
/// </remarks>
public class StringClobType : StringType
{
internal StringClobType() : base( new StringClobSqlType() )
{
}
internal StringClobType(StringSqlType sqlType) : base(sqlType)
{
}
public override string Name
{
get {return "StringClob"; }
}
}
}
--- NEW FILE: BinaryBlobType.cs ---
using System;
using System.Data;
using NHibernate.SqlTypes;
namespace NHibernate.Type
{
/// <summary>
/// Maps a System.Byte[] Property to an column that can store a BLOB.
/// </summary>
/// <remarks>
/// This is only needed by DataProviders (SqlClient) that need to specify a Size for the
/// IDbDataParameter. Most DataProvider(Oralce) don't need to set the Size so a BinaryType
/// would work just fine.
/// </remarks>
public class BinaryBlobType : BinaryType
{
internal BinaryBlobType() : base( new BinaryBlobSqlType() )
{
}
internal BinaryBlobType(BinarySqlType sqlType) : base(sqlType)
{
}
public override string Name
{
get {return "BinaryBlob"; }
}
}
}
|