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 7633585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:55:34+00:00 2026-05-31T06:55:34+00:00

Is it possible to validate whole graph automatically ? By full graph I mean

  • 0

Is it possible to validate whole graph automatically ? By full graph I mean the object that is being validated and all its fields that are beans too.

Or I have to traverse through them manually as shown below ?

Currently I do something like this

    Set<ConstraintViolation<OrderProxy>> violationsOrder = 
         validator.validate(order, Default.class, ClientGroup.class);
    Set<ConstraintViolation<OrganizationProxy>> violationsOrg =  
         validator.validate(order.getSender(), Default.class, ClientGroup.class);
    Set<ConstraintViolation<PersonProxy>> violationsPerson = 
         validator.validate(order.getSender().getPerson(), 
                               Default.class, ClientGroup.class);
  • 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-31T06:55:36+00:00Added an answer on May 31, 2026 at 6:55 am

    You can annotate any fields that you want validated with @Valid and when validating your main object, it will also validate the fields.

    This works for example:

    public class Order
        @Valid
        protected Header header;
        @Valid
        protected List<Detail> details;
    }
    

    You would need to call

    Set<ConstraintViolation<Order>> violationsOrder = validator.validate(order, Default.class, ClientGroup.class);
    

    to get all violations (also those for the fields). You would then have to parse the causes using getPropertyPath() to get the exact validation source, if you need it.

    javax.validation.Path rp = violation.getPropertyPath();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to validate an xml file against its associated schema using Visual
Can anyone tell me if its possible to validate a link with php? By
Is it possible to use a RegEx to validate, or sanitize Base64 data? That's
Is it possible to validate a radio group (so something is checked off, or
I am wondering if it is possible to validate parameters to (custom) .net attributes.
With FluentValidation, is it possible to validate a string as a parseable DateTime without
Is it possible for a .xsd file to also validate a .xml file by
I need to validate as fast as possible and receive the next xml-data on
Is that possible to pass variable into regular expression pattern string in jquery (
I need to validate an email address which will be transmitted to several possible

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.