Hi try the following:

var cfg = new Configuration();
cfg.Configure();
cfg.AddAssembly(typeof (Fish).Assembly);

ValidatorEngine engine = new ValidatorEngine();
engine.Configure();

//Registering of Listeners and DDL-applying here
ValidatorInitializer.Initialize(cfg, engine);

new SchemaExport(cfg).Execute(true, true, false, true);

Gustavo.

On Sat, Oct 4, 2008 at 2:15 PM, orjan <[EMAIL PROTECTED]> wrote:

>
> First of all I would like to say that Nhibernate Validator is a lovely
> tool. It works as expected both in the domain and in update and insert
> statements. I have a small issue with the DB-constraints when i run:
> var cfg = new Configuration();
>            cfg.Configure();
>            cfg.AddAssembly(typeof (Fish).Assembly);
>            new SchemaExport(cfg).Execute(true, true, false, true);
>
> for example a [NotNull] attribute isn't transmitted to the column as
> stated in the document below. Any idea what's wrong?
>
> http://www.nhforge.org/wikis/validator10/nhibernate-validator-1-0-0.aspx
>
> "
> Database schema-level validation
>
> Out of the box, NHibernate Validator will translate the constraints
> you have defined for your entities into mapping metadata. For example,
> if a property of your entity has the attribute [NotNull], its columns
> will be declared as not null in the DDL schema generated by
> NHibernate.
>
> Using hbm2ddl, domain model constraints will be expressed into the
> database schema.
>
> If, for some reason, the feature needs to be disabled, set
> apply_to_ddl to false.
> "
>
> Regards,
>
> Örjan
>
> >
>

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