You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Igor Vaynberg <ig...@gmail.com> on 2012/11/25 07:40:31 UTC

initial bean validation integration checked into experimental module

just checked in a first pass on bean validation (jsr 303) integration.
see this commit for details:

https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=580a8dd9;hp=2d47bf340875f6053aa2a3b69c4f442f2fbb03e1

feedback is welome.

-igor

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: initial bean validation integration checked into experimental module

Posted by Igor Vaynberg <ig...@gmail.com>.
On Sun, Nov 25, 2012 at 4:12 PM, Paul Bors <pa...@bors.ws> wrote:
> Looks awesome!
>
> One suggestion/question about it (might sound silly at first but keep an
> open mind).
>
> I understand you're implementing the JSR-303, but I was wondering if it
> would be possible to allow some of the settings be borrowed from other
> annotation framework like Hibernate or some other 3rd party not necessary
> out of the box but perhaps via a user defined mapping?
>
> Given your example POJO:
> public class Person implements Serializable
> {
>        @NotNull
>        @Size(min = 2, max = 30)
>        private String name;
> ...
>
> If one were to use the same POJO to map it via Hibernate the code would look
> like:
> @Entity
> public class Person implements Serializable
> {
>        @NotNull
>        @Size(min = 2, max = 30)
>        @Column(name = "full_name", nullable = false, length=30)
>        private String name;
> ...
>
> That seems like duplicated meta data to me since you're defining the same
> info twice such as the null state and length in two or more different
> annotations.

i believe you are coming into this from the wrong angle. the
integration should not be between Wicket validation and hibernate
annotations, the integration should instead be between bean validation
(303) and hibernate annotations.

303 provides the validator and the metadata constraint discovery which
i use. if you choose to integrate between wicket and hibernate
annotations you have to basically build a parallel 303 implementation.

instead, figure out how to integrate hibernate annotations with 303
and you get to piggy back on everything thats already there.

-igor


>
> ~ Thank you,
>   Paul Bors
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: Sunday, November 25, 2012 1:41 AM
> To: users@wicket.apache.org
> Subject: initial bean validation integration checked into experimental
> module
>
> just checked in a first pass on bean validation (jsr 303) integration.
> see this commit for details:
>
> https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=580a8dd9
> ;hp=2d47bf340875f6053aa2a3b69c4f442f2fbb03e1
>
> feedback is welome.
>
> -igor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: initial bean validation integration checked into experimental module

Posted by Paul Bors <pa...@bors.ws>.
Looks awesome!

One suggestion/question about it (might sound silly at first but keep an
open mind).

I understand you're implementing the JSR-303, but I was wondering if it
would be possible to allow some of the settings be borrowed from other
annotation framework like Hibernate or some other 3rd party not necessary
out of the box but perhaps via a user defined mapping?

Given your example POJO:
public class Person implements Serializable 
{
       @NotNull
       @Size(min = 2, max = 30)
       private String name;
...

If one were to use the same POJO to map it via Hibernate the code would look
like:
@Entity
public class Person implements Serializable 
{
       @NotNull
       @Size(min = 2, max = 30)
       @Column(name = "full_name", nullable = false, length=30)
       private String name;
...

That seems like duplicated meta data to me since you're defining the same
info twice such as the null state and length in two or more different
annotations.

~ Thank you,
  Paul Bors

-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Sent: Sunday, November 25, 2012 1:41 AM
To: users@wicket.apache.org
Subject: initial bean validation integration checked into experimental
module

just checked in a first pass on bean validation (jsr 303) integration.
see this commit for details:

https://git-wip-us.apache.org/repos/asf?p=wicket.git;a=commitdiff;h=580a8dd9
;hp=2d47bf340875f6053aa2a3b69c4f442f2fbb03e1

feedback is welome.

-igor

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org