[hibernate-dev] [HV] Extending ParameterNameProvider contract for other element types

Emmanuel Bernard emmanuel at hibernate.org
Wed Oct 2 08:46:17 EDT 2013


But then the JSON binding technology should be responsible for the
property anme conversion too, right? After all that is the layer that
does this change.

On Thu 2013-09-19 10:35, Gunnar Morling wrote:
> I also think that the conversion of the ConstraintViolation(s) into another
> format is more in the responsibility of the integrating technology.
> 
> Taking JAX-RS/Resteasy as example, it will transparently convert any
> constraint violation objects into an equivalent XML or JSON response.
> Provided we return the wished property name in the reported violation,
> Resteasy's conversion would take over from there.
> 
> 
> 2013/9/19 Hardy Ferentschik <hardy at hibernate.org>
> 
> >
> > 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
> >
> >
> > _______________________________________________
> > hibernate-dev mailing list
> > hibernate-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
> >
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev


More information about the hibernate-dev mailing list