views:

140

answers:

1

Hello.
Does Spring Batch framework provide its specific validation mechanism?
I mean, how it's possible to specify validation bean?

Is spring Validator acceptable see example here ?

My validation is result of @NamedQuery - if query returned result, the validation is OK, else - false.

A: 

I would suggest that you use a step to validate the data.

If the step does not return an element, the element is 'forgotten' and next one is treated. If your query returns data, then make the step return the element. It will be treated by next step (classical behavior).

You can even imagine creating a Validation Service (Spring service) and use a TaskletAdapter which will delegate the validation to your service.

Jean-Philippe Briend