tag:blogger.com,1999:blog-3924739636407907202.post8610713714312549412..comments2023-10-07T05:59:41.036-03:00Comments on HunabKu: Validation through persistence: synchronizedFabio Maulohttp://www.blogger.com/profile/13558454874302740335noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-3924739636407907202.post-55705518700504922042010-07-22T16:39:08.370-03:002010-07-22T16:39:08.370-03:00If you use the entity validation event listener in...If you use the entity validation event listener integration, you have a chicken & egg problem. Can't build a session factory without the listener, which requires the validators to be built. Can't build the validators without a session factory.Jason Dentlerhttps://www.blogger.com/profile/04338106963683764289noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-11000713589244140642009-11-03T11:55:10.950-03:002009-11-03T11:55:10.950-03:00I'm not sure I've caught your idea.
I wou...I'm not sure I've caught your idea.<br /><br />I would appreciate if you could show me the code-line that will allow me to specify the order of error messages using Linq.<br /><br />However, the example above is just an example of an advantage of using ordered validation. There may be other cases when it is needed. In more complex example, I may have several custom validators which do Dmitry Karpenkovhttps://www.blogger.com/profile/06612756499008537002noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-25238922394452027772009-11-03T09:49:51.246-03:002009-11-03T09:49:51.246-03:00In the InvalidValue you having what you need to cr...In the InvalidValue you having what you need to create an orderd message base on the order in the UI (using Linq it is a code-line).Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-39331866140518061352009-11-03T06:18:27.247-03:002009-11-03T06:18:27.247-03:00My main target is to be able to handle the order i...My main target is to be able to handle the order in which validation errors are returned when I call ValidatorEngine.Validate(entity).<br /><br />I'll try to explain further. Let's imagine we have a user form with the following inputs:<br />* Date<br />* Title<br />* Comment<br />If I fill in nothing I will see validation summary like below:<br />* Date cannot be null.<br />* Title cannotDmitry Karpenkovhttps://www.blogger.com/profile/06612756499008537002noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-88019944404662905172009-11-02T14:07:00.395-03:002009-11-02T14:07:00.395-03:00Which is the advantage or which should be the targ...Which is the advantage or which should be the target of an ordered evaluation of constraints ?Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-20116524420244267782009-11-02T05:41:06.172-03:002009-11-02T05:41:06.172-03:00Sure.
Let's have your BlogPost class below fo...Sure.<br /><br />Let's have your BlogPost class below for example. It has Title, Date, Comment properties. Let's say all of them have NotNull validation. What I need is to ask NHibernate.Validator to validate my object values using the following order: Date, Comment, Title. And then when I ask it to validate and return error messages, I would like to have those messages in the same order.Dmitry Karpenkovhttps://www.blogger.com/profile/06612756499008537002noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-23434683569387774212009-10-30T20:22:30.127-03:002009-10-30T20:22:30.127-03:00Can you elaborate an example of what you need ?Can you elaborate an example of what you need ?Fabio Maulohttps://www.blogger.com/profile/13558454874302740335noreply@blogger.comtag:blogger.com,1999:blog-3924739636407907202.post-6422521345461560322009-10-30T13:46:01.492-03:002009-10-30T13:46:01.492-03:00Just out of curiosity. Is there a way to define th...Just out of curiosity. Is there a way to define the order in which validators will be executed and as a result the error messages will be returned?<br /><br />Thanks.Dmitry Karpenkovhttps://www.blogger.com/profile/06612756499008537002noreply@blogger.com