camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brad Johnson <>
Subject Any good examples of Bean Validation?
Date Fri, 12 Aug 2016 15:29:44 GMT

The documentation is pretty thin there.  A good code fragment might be
worth 10,000 words in this case.

While I'm using beanio to unmarshal records into beans I think I'd prefer
to leave it out of the validation.  There are a couple of reasons for
that.  The annotations for bean validation might be used in a lot of
different situations including writing out to a database or file system in
addition to reading in.  Second the validation mechanics permit optional
validation rules depending on the situation.

So I'd prefer to just unmarshal and then separately validate.

Probably the most important reason for using the annotations though is that
it makes it easier for business folks to use for specification of canonical
data models for the organization.  And that's also where the optional
annotations for validation become important.  An invoice ID in context 1
might have to be an integer of X length while in context 2 null might be
OK.  So this eases that.

But I don't have a good working example.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message