The default is the opposite and you can't change it on the compiled version.
But since NH is open source, you can modify lines 197 and 198 in
src/NHibernateType/TypeFactory.cs to use AnsiString instead of String.
Or you can leave it as-is and pay a third-world contractor 50 bucks to
change your mappings.
Diego
On Thu, Sep 16, 2010 at 05:13, Armin Landscheidt <
[email protected]> wrote:
> What I need is a default mapping from System.String to AnsiString. So I
> could use both if I want. In the SqlDriver I can replace string with
> ansistring but if I do so I can't use string anymore.
>
> 2010/9/16 Fabio Maulo <[email protected]>
>
> Driver and Dialect are dbspecific
>>
>> --
>> Fabio Maulo
>>
>>
>> El 15/09/2010, a las 17:53, Armin Landscheidt <[email protected]>
>> escribió:
>>
>> > I've experimented with overriding and inheriting the Dialect and
>> > SqlDriver but I can't find a dependency to the used database types. It
>> > seems that I can't change the typmapping through implementing my own
>> > SqlDriver without having a lot of work. Maybe there is a better way in
>> > the ClassBinder? So I could set the propertytype to Ansistring if it
>> > was set through the .NET String type.
>> >
>> > On Sep 14, 10:21 am, Armin Landscheidt <[email protected]> wrote:
>> >> I think I won't use another tool for this case. If it is possible I
>> >> would override this part in the SqlClientDriver.
>> >> Could someone help me out and give me an hint how to do this? I've
>> >> looked at the methodes but I haven't found the right one yet.
>> >>
>> >> On 13 Sep., 13:53, Diego Mijelshon <[email protected]> wrote:
>> >>
>> >>> mapper is a ConfOrm.NH.Mapper instance.
>> >>
>> >>> While ConfORM is best suited for model-first development, it works
>> very well
>> >>> on databases with well-defined standards.
>> >>
>> >>> Diego
>> >>
>> >>> On Mon, Sep 13, 2010 at 05:30, Armin Landscheidt <
>> >>
>> >>> [email protected]> wrote:
>> >>>> Thanks for your answers.
>> >>
>> >>>> How can I set the type this way ?
>> >>
>> >>>> mapper.AddPropertyPattern(p => p.GetPropertyOrFieldType() ==
>> typeof(string), pm => pm.Type(NHibernateUtil.AnsiString));
>> >>
>> >>>> whats mapper in this case?
>> >>
>> >>>> --
>> >>>> You received this message because you are subscribed to the Google
>> Groups
>> >>>> "nhusers" group.
>> >>>> To post to this group, send email to [email protected].
>> >>>> To unsubscribe from this group, send email to
>> >>>> [email protected]<nhusers%[email protected]>
>> <nhusers%[email protected]<nhusers%[email protected]>
>> >
>> >>>> .
>> >>>> For more options, visit this group at
>> >>>> http://groups.google.com/group/nhusers?hl=en.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "nhusers" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> [email protected]<nhusers%[email protected]>
>> .
>> > For more options, visit this group at
>> http://groups.google.com/group/nhusers?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "nhusers" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<nhusers%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/nhusers?hl=en.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "nhusers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"nhusers" 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/nhusers?hl=en.