You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ryan Sonnek <ry...@gmail.com> on 2007/10/01 01:41:30 UTC

Re: Help - Best Practice - Mapping Database Constraint Violation to User Interface

Just to follow up about wicket-hibernate integration...

It's a library that automatically adds wicket validation based upon your
hibernate/JPA annotations.  So, if you have a property marked as not-null or
max-length of 10, wicket will automatically add client side validation and
pretty error messages for these constraints.

On 9/29/07, mchack <mc...@cisco.com> wrote:
>
>
> Thanks for the replies. My intent was to provide information specific to
> the
> column(s) that produced the violation so as to provide reasonable feedback
> to the user. As I did more research it looks like the detail that is
> provided on exception is DB dependant :(
>
> -Mike
>
>
> Martijn Dashorst wrote:
> >
> > In your onSubmit, link click, etc.:
> >
> > try {
> >     doDatabaseOperationThatThrowsContraintViolation();
> >     transaction.commit();
> > }
> > catch(OrmSpecificException e) {
> >     error("Something bad has happened. Read this if it helps you: " +
> > e.getMessage());
> >     transaction.rollback();
> >     return;
> > }
> >
> > and make sure you have a feedback panel on the page. This is basically
> > a dumbed down version of how we do it in our application (or should
> > do, rather).
> >
> > Martijn
> >
> > On 9/29/07, mchack <mc...@cisco.com> wrote:
> >>
> >> Could someone provide a pointer/link as to the best mechanism to map DB
> >> constraint violations from Hibernate (or ORM layer) back to the user
> >> interface layer. I'm sure this has been solved but wasn't successful in
> >> searching for an answer.
> >>
> >> -Mike
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Help---Best-Practice---Mapping-Database-Constraint-Violation-to-User-Interface-tf4539361.html#a12955404
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Buy Wicket in Action: http://manning.com/dashorst
> > Apache Wicket 1.3.0-beta3 is released
> > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-beta3/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Help---Best-Practice---Mapping-Database-Constraint-Violation-to-User-Interface-tf4539361.html#a12956194
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>