No Ideas? This has me stumped so far.

Alec Whittington




On Mon, Dec 8, 2008 at 11:39 AM, Alec Whittington <
[EMAIL PROTECTED]> wrote:

> Hi all,   I realize this might not be the best place to ask, but thought I
> would start here first then move up the stack as needed.
>
> I have a class, ApplicationLog, that I use for logging Log4Net messages.
> One of the properties for the class is "Message". Nothing special, just a
> string.
> I would like to represent this as a text field in the database. My mapping
> for the field is as such:
>
> Map(x => x.Message).CustomTypeIs("StringClob").CustomSqlTypeIs("text");
>
> In the mapping file (shown in the applications text log) I noticed that it
> was correct with the exception that is has a length on it.
>
> When I generate the SQL script, it does not generate that field in the
> table correctly. It generates it as a nvarchar(100) instead of ntext. I am
> sure I am not the only one that has encountered this issue within the group.
> I am generating the SQL script against a SQL 2005 Dev Ed database, not
> SQLExpress. Here is the code for generating the SQL file:
>
>         [Test]
>         public void CreateSchema()
>         {
>             Configuration cfg = new Configuration().Configure();
>             var persistenceModel = new PersistenceModel();
>             persistenceModel.addMappingsFromAssembly(
>                 Assembly.Load("Tubbed.Data"));
>             persistenceModel.Configure(cfg);
>             new 
> SchemaExport(cfg).SetOutputFile(@"c:\tubbed.sql").Create(true, false);
>             //new SchemaUpdate(cfg).Execute(true, false);
>         }
>
> Here is my mapping file:
>
>         public ApplicationLogMap()
>         {
>             WithTable("ApplicationLog");
>
>             Id(x => x.LogEntryID);
>
>             Map(x => x.Date);
>             Map(x => x.Level).WithLengthOf(50);
>             Map(x => x.Logger).WithLengthOf(255);
>             Map(x => 
> x.Message)CustomTypeIs("StringClob").CustomSqlTypeIs("text");
>             Map(x => x.Thread).WithLengthOf(50);
>         }
>
> As stated above, when I look at the mapping file in the log, it appears 
> correct, with exception of the length field. All fields look good in the SQL 
> script except for Message which comes out as:
>
> Message NVARCHAR(100) NULL
>
>  Any help is appreciated.
>
> Thanks,
>
> Alec Whittington
>
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to