posted 5 years ago
Hi,
I will have to validate my JSON, before persisting it to the database as JSON(clob). To serve this purpose, I have used javax annotations and also custom annotations on my model class. The validation is happening as expected and it works just fine.
But, if I have to retrieve the JSON and map it to my model class, javax validation will jump in again. As it does not make sense to validate a JSON, which I already did while persisting it, I want to know, if there is a way to by-pass the validation while mapping the JSON to model class.
One alternative I can think of is, to have a similar model class, without any annotations and use this to map my JSON, while retrieving it. But, its a lame alternative.
Suggestions are welcome.
Thanks,
Ashwin