Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6695233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:11:48+00:00 2026-05-26T06:11:48+00:00

If I am using the javax.validation.Validator to validate an object annotated with constraints, will

  • 0

If I am using the javax.validation.Validator to validate an object annotated with constraints, will it always evaluate the field level constraints before the object?

For example if I have:

@DummyClassValidation
public static class DummyClassToValidate {

    private Integer myNum;

    @Min(value = 50)
    @Max(value = 100)
    public Integer getMyNum() {
        return myNum;
    }

    public void setMyNum(Integer myNum) {
        this.myNum = myNum;
    }
}

And I validate it, is it guaranteed that the @DummyClassValidation will be evaluated only after @Min and @Max? I know I can do so with Groupings but I rather not if I don’t have to (i.e. Field validations are implicitly grouped to validate before object validations).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:11:49+00:00Added an answer on May 26, 2026 at 6:11 am

    Per the specification, section 3.5:

    For a given group to validate, the validation routine applied on a
    given bean instance is expected to execute the following constraint
    validations in no particular order:

    • for all reachable fields,
      execute all field level validations (including the ones expressed on
      superclasses) matching the targeted group unless the given validation
      constraint has already been processed during this validation routine
      for a given navigation path (see Section 3.5.1) as part of a previous
      group match.

    • for all reachable getters, execute all getter level
      validations (including the ones expressed on interfaces and
      superclasses) matching the targeted group unless the given validation
      constraint has already been processed during this validation routine
      for a given navigation path (see Section 3.5.1) as part of a previous
      group match.

    • execute all class level validations (including the ones
      expressed on interfaces and superclasses) matching the targeted group
      unless the given validation constraint has already been processed
      during this validation routine for a given navigation path (see
      Section 3.5.1) as part of a previous group match.

    • for all reachable
      and cascadable associations, execute all cascading validations (see
      Section 3.5.1) including the ones expressed on interfaces and
      superclasses (see Section 3.4.5)

    In short, you can’t rely on that unless you want to find an implementation that guarantees it and stick with that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Java, I can validate an XML document against an XSD schema using javax.xml.validation.Validator,
I'm using Java 5 javax.xml.validation.Validator to validate XML file. I've done it for one
I am validating an in-memory DOM object using the javax.xml.validation.Validator class against an XSD
I'm working with SOAP using the javax.xml.soap package. I have a javax.xml.soap.SOAPMessage object that
I'm using spring based validation in combination with hibernate validator enabled by the following
I'm using Hibernate Validator. I have a Class level annotation. It compares three properties
I am using the struts2 validation framework to validate the data from in client.
I'm using javax naming to connect to an LDAP database. Is there a good
I am using javax.scripting to add support for running arbitrary user-uploaded JavaScripts on the
I programmed a bluetooth Television-Remote control for cellphones in J2ME using javax.microedition.lcdui.* (Gauge, List,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.