[hibernate-dev] [HV] Extending ParameterNameProvider contract for other element types
Hardy Ferentschik
hardy at hibernate.org
Thu Sep 19 04:16:02 EDT 2013
On 19 Jan 2013, at 9:44 AM, Emmanuel Bernard <emmanuel at hibernate.org> wrote:
> It seems that what this user really needs is a way to convert the Set<ConstraintViolation> into another format entirely, JSON in this case. I wonder if we could find a more generic approach than just the ability to change properties names.
Well, there are really two problems. First the creation of the JSON format and then the property name "conversion". I think they need to be addressed separately. Even if we had/offered something to convert the constraint violations, we still
would report the actual property name.
In the described use case I would write the conversion code myself. The constraint violation contains all the information needed to create the JSON format and do the name conversion. It should not be hard to write.
--Hardy
More information about the hibernate-dev
mailing list