Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject:
PostPosted: Wed Dec 05, 2007 8:28 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
But that's the first time I see a Linkage error

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 8:33 pm 
Beginner
Beginner

Joined: Fri Nov 03, 2006 3:21 pm
Posts: 30
hmm? Linkage error!?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 8:37 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
ah wrong post :)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 8:39 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
BTW, I haven't drop your use case (even if I find it fairly border case), but I still don't like the solution(s) for it. We are discussing similar topics in the JSR-303 EG

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 9:10 pm 
Beginner
Beginner

Joined: Fri Nov 03, 2006 3:21 pm
Posts: 30
If you have any other solution, ok.
I know the JSR 303 but I don't know when it will be completed or on what you discuss.
You could share some information or conclusion about this with us?
That your message ends the discussion of this topic?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 25, 2007 12:24 pm 
Newbie

Joined: Tue Dec 25, 2007 11:11 am
Posts: 2
bruno.braga, his idea is very good. I hope that developers approve it. HV is good, but needs a few more advanced features.

Merry Christmas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 11, 2008 11:32 pm 
Newbie

Joined: Sun Mar 30, 2008 12:19 am
Posts: 15
emmanuel,

One way this might be more graceful to solve is if groups could be determined by a class to determine validation of its properties. Then rather than having applyIf on every annotation to allow specifying script, you have a base annotation that determines which set(s) to apply.

Not saying I'm ecstatic about such an approach. I rather like the idea of making new complex constraints java classes.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 14, 2008 2:37 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Can you expand on your idea?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 14, 2008 6:20 pm 
Newbie

Joined: Sun Mar 30, 2008 12:19 am
Posts: 15
emmanuel wrote:
Can you expand on your idea?


Well based on an earlier example in the thread:

Code:
@DeliveryMethod
class Delivery {
    boolean receiveNews;
    boolean phonePreferred;

    @NotNull(groups={"byAddress"})
    private String street;
   
    @NotNull(groups={"byAddress"})
    private String city;

    @NotNull(groups={"byAddress"})
    @Length(2)
    private String state;

    @NotNull(groups={"byAddress"})
    @Max(99999)
    @Min(0)
    private Integer zip;

    @NotNull(groups={"byPhone"})
    @PhoneNumber
    public String getTelephone() {
        return telephone;
    }
}


The DeliveryMethodValidator would expose any groups which should be used to validate the members of the class. This way, it can make high level business decisions, but the regular annotations could be used for the low level validation rules.

I also had a similar thought on leveraging groups in this way for "key" and "value" special groups, to allow validation of the individual elements of collections and maps.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 39 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.