I've run in to some trouble with the NHibernate integration when using the
fluent configuration syntax. Here is my configuration.
var validationCfg = new FluentConfiguration();
validationCfg.Register(new[] {typeof (ProductValidator)})
.SetDefaultValidatorMode(ValidatorMode.UseExternal)
.IntegrateWithNHibernate
.ApplyingDDLConstraints().And
.RegisteringListeners();
var validatorEngine = new ValidatorEngine();
validatorEngine.Configure(validationCfg);
var nhibernateCfg = new Configuration().Configure();
nhibernateCfg.Initialize(validatorEngine);
I can use validatorEngine.Validate and get the expected validation errors,
so nhv is configured properly. Also, the nhv constraints are included with
hbm2ddl. However, an attempt to save an invalid entity goes all the way to
the database and throws a SqlException for the constraint violation. I was
expecting the nhv event listeners to throw an InvalidStateException.
To add a twist to this puzzle, with the debugger, I can see the nhv event
listeners on my configuration object.
Any ideas?
Thanks,
Jason
--
You received this message because you are subscribed to the Google Groups
"NHibernate Contrib - Development Group" 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/nhcdevs?hl=en.