I looked at both Hibernate and Spring Validation briefly today.
Hibernate is annotation-based and works something like this: (1) You annotate with the proper validation rule (e.g., @NotNull) on the fields of your bean; (2) You call Hibernate's ClassValidator to validate, which returns the validation errors. Presumably, it inspects the annotations on the bean fields and performs the appropriate validation.
Pros: Easy declaration based validation.
Cons: I haven't figure out a way to perform database check for uniqueness.
Spring's validation is programatically-based. You implement the Validator interface which contains two methods, one of which is the validate method. You perform your validation manually, either writing the rules yourself or using Spring's utility methods, e.g., ValidationUtils.rejectIfEmpty(...)
Pros: Very flexible which allows for database record-based validation
Cons: More complex than Hibernate's Validator.
Neither solution is particularly ideal. Hibernate seems too simplistic while Spring's requires too much programming. I lean towards Spring's Validator mainly because it's very apparent as to how one would perform database record validation.
Reference:
Tutorial: Getting Started with Hibernate Validator
[Chapter] 6.2 Validation using Spring's Validator interface
Subscribe to:
Post Comments (Atom)
Such a great information for blogger i am a professional blogger thanks…
ReplyDeleteLearn Best Microstrategy Training in Bangalore from Experts. Softgen Infotech offers the Best RPA Training in Bangalore.100% Placement Assistance, Live Classroom Sessions, Only Technical Profiles, 24x7 Lab Infrastructure Support.
I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines content is very nice.
ReplyDeletepython training in chennai
python online training in chennai
python training in bangalore
python training in hyderabad
python online training
python flask training
python flask online training
python training in coimbatore
thanks for giving the detailed information with us.it helps us to learn more about this article.this kind of blog is shows collection of new ideas with excellent presentation.
ReplyDeleteangular js training in chennai
angular js training in tambaram
full stack training in chennai
full stack training in tambaram
php training in chennai
php training in tambaram
photoshop training in chennai
photoshop training in tambaram
Wonderful blog with great piece of information. Regards to your effort. Keep sharing more such blogs.Looking forward to learn more from you.
ReplyDeleteoracle training in chennai
oracle training in porur
oracle dba training in chennai
oracle dba training in porur
ccna training in chennai
ccna training in porur
seo training in chennai
seo training in porur
instagram takipçi satın al
ReplyDeleteaşk kitapları
tiktok takipçi satın al
instagram beğeni satın al
youtube abone satın al
twitter takipçi satın al
tiktok beğeni satın al
tiktok izlenme satın al
twitter takipçi satın al
tiktok takipçi satın al
youtube abone satın al
tiktok beğeni satın al
instagram beğeni satın al
trend topic satın al
trend topic satın al
youtube abone satın al
instagram takipçi satın al
beğeni satın al
tiktok izlenme satın al
sms onay
youtube izlenme satın al
tiktok beğeni satın al
sms onay
sms onay
perde modelleri
instagram takipçi satın al
takipçi satın al
tiktok jeton hilesi
instagram takipçi satın al
pubg uc satın al
sultanbet
marsbahis
betboo
betboo
betboo
ucuz takipçi
ReplyDeleteucuz takipçi
tiktok izlenme satın al
binance güvenilir mi
okex güvenilir mi
paribu güvenilir mi
bitexen güvenilir mi
coinbase güvenilir mi
mmorpg oyunlar
ReplyDeleteInstagram Takipçi Satın Al
TİKTOK JETON HİLESİ
tiktok jeton hilesi
antalya saç ekimi
İnstagram takipçi satın al
takipci satın al
metin2 pvp serverlar
instagram takipçi satın al
NordVPN 2022 Crack is the software of your best choice to hide your identity from the internet endeavors to attack your personal information.! Nord VPN Cracked
ReplyDelete