The open door that the EventListeners port let for us, it’s the possibility to create some classes in order to validate objects before them were saved (and before were deleted too).

An option is port Hibernate.Validator, but… will be used by anyone? I don’t think so. Looking it implementation and what it do, do not offer much more that you can find of .Net side with some existent libraries. Maybe some day Hibernate.Validator will be ported, by now, I think that it’s so much important finish the port of the features of Hibernate 3.2.5 GA.

Another valid option, it’s create bridges between NHibernate (EventListeners) and somes known framework for .Net for input validation:

The implementation, either Hibernate.Validator (I don’t think so) or the bridges for the citated, will be at uNHAddIns.

An interesting point, will be the extensibility option for home made validatores.

 
  • Viswanth

    Hi,
    I’m using NHibernate2.0 and have an insert that inserts zero (0) into my column if the user doesn’t provide the input. It is of type integer and the real problem is while fetching the data back the field value reads 0. How to validate or set the data as db null when the user hasn’t given input.

    Thanks!