This may solve my problem, and I may need to create some extra attributes to mark which property need to be checked. By the way, I don't think getting the current Property and current Entity's information in the validator would break the independency. I want to know which would be checked, not just the value.
On Tue, Feb 24, 2009 at 10:24 PM, Dario Quintana < [email protected]> wrote: > Hi > > Create a Bean-Validator (example a [MyPropertyUnique] in the class instead > of property), that means that involve the whole entity. > > Cheers > > > On Tue, Feb 24, 2009 at 6:02 AM, Karron Qiu <[email protected]> wrote: > >> I want to write my own constraint for checking if the property's value is >> unique in database. But the IValidator interface only give me the value of >> the property. If I inplement IPropertyConstraint interface, I can get the >> name of the property, but I still can't get the information of the entity >> that will be validated. Because I need to know the type of the entity to >> create a criteria. >> >> Anyone can give me some advice? Thanks. >> >> -- >> Regards, >> Karron >> >> >> >> > > > -- > Dario Quintana > http://darioquintana.com.ar > > > > > -- Regards, Karron --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
