Thanks for your fast response, but I can't get this to work.

My Dialect (the method is called during startup, so it should be
configured correctly):
   public class ExtendedOracleDialect : Oracle10gDialect {
      protected override void RegisterFunctions() {
         base.RegisterFunctions();
         RegisterFunction("empty_clob", new
NoArgSQLFunction("empty_clob", NHibernateUtil.String, true));
      }
   }

My mapping (inside a double nested-composite-element, but I hope this
doesn't change anything):
            <property name="Formatted" type="System.String, mscorlib,
Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
              <column name="ERSETZUNG_FORMATIERT"
default="empty_clob()" />
            </property>

But the generated insert statements are still using '' for
String.Empty and NULL for null instead of empty_clob(), which I need
in both cases.

On 1 Okt., 14:58, Fabio Maulo <[email protected]> wrote:
> After register the empty_clob() function in your own dialect, you can try
> using the "default" attribute of <column>.
>
>
>
> On Fri, Oct 1, 2010 at 9:53 AM, cremor <[email protected]> wrote:
> > Is there a way to tell NHibernate to replace all values of empty
> > strings with the Oracle function empty_clob() in inserts/updates to a
> > specific column?
>
> > I'd need this to insert a empty string to a CLOB column which has a
> > NOT NULL constraint (Oracle treats empty strings the same as NULLs, so
> > it tries to insert a NULL to my CLOB column).
>
> > --
> > 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.
>
> --
> Fabio Maulo

-- 
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.

Reply via email to