Thanks, Fabio.
On 24 сен, 17:32, Fabio Maulo <[email protected]> wrote:
> have a look to <default> tag.<column name="created_by" length="50"
> default="SYSTEM_USER"/>
>
> 2009/9/24 shapovalov <[email protected]>
>
>
>
>
>
> > Hello,
>
> > When creating new entry in database I need to insert default values
> > for properties with null values.
> > For example
> > class Person
> > {
> > string name;
> > string department;
> > }
>
> > person.name = "alexander";
> > person.department = null;
> > session.Save<Person>(person);
>
> > It should insert default value for department in table BUT
> > if person.department not null it must insert value from this property
>
> > mapping generated="insert" insert always default value for this
> > property,
> > but I need database default value only if property is null
>
> > Is it possible?
>
> > Thanks,
> > Alexander.
>
> --
> 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
-~----------~----~----~----~------~----~------~--~---