Bean Validation 1.1

Learn how to create and add business constraints to your Java SE and Java EE applications.
Course info
Rating
(105)
Level
Intermediate
Updated
Jan 28, 2014
Duration
2h 31m
Table of contents
Course Overview
Introduction
Understanding Bean Validation
Validating Built-in Constraints
Defining our own Constraints
Messages, Groups and Payloads
Advanced Topics
Bean Validation 1.1 within Java EE 7
Description
Course info
Rating
(105)
Level
Intermediate
Updated
Jan 28, 2014
Duration
2h 31m
Description

Processing, storing, and retrieving valid data is crucial for an application, that's why validation is a common task that needs to be done in several layers of your application. In this course you will learn how Bean Validation allows developers to write constraints in a standard way and apply them everywhere (bean, properties, constructors, method parameters, and return value). You will also see how Bean Validation can be integrated in other Java EE specifications.

About the author
About the author

Antonio is a senior software architect living in Paris.

More from the author
Java Persistence API 2.2
Intermediate
4h 15m
May 10, 2019
Microservices: The Big Picture
Beginner
1h 45m
Apr 16, 2018
Java EE: Getting Started
Beginner
5h 0m
Jun 22, 2017
More courses by Antonio Goncalves
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Antonio Goncalves. Welcome to my course Bean Validation 1. 1. I am an independent developer, a book author, and a recognized Java Champion. I'm also part of the Java EE Expert Group and like to speak at international technical conferences. So, if you know Java EE or Spring and you need to better validate your data, this course is for you. In this course, you will learn Bean Validation, the Java EE specification allowing you to constrain your data. Some of the major topics that I will cover include understanding Bean Validation and its advantages over validating programmatically, how to use built-in constraints in your code, as well as defining your own constraints. You will be able to apply constraints everywhere on attributes, classes, methods, and constructors. You will also learn a few advanced topics such as dealing with error messages or grouping constraints together. Finally, you'll learn how to put all these pieces together inside or outside Java EE so you can bring Bean Validation to your projects. By the end of this course, you'll have a very good understanding of which data you can validate and constrain with Bean Validation. Before beginning the course, you should be familiar with the Java programming language. This course will guide you step by step in using constrains in most of your business rules. I hope you'll join me on this journey to learn data validation with Bean Validation 1. 1 course at Pluralsight.

Understanding Bean Validation
Hi. My name is Antonio Goncalves, and I want to welcome you to this module about Understanding Bean Validation. I will use this second module to show you what Bean Validation is and what it's not. In this module, I will recap what validation is and in which layers of our application we usually validate data. Once you have understood how we usually validate data, then I will introduce Bean Validation, tell you what it is, what it does, but also what it's not. Bean Validation comes with built-in constraints, but you can easily create your own within Java SE, but also in Java EE.

Validating Built-in Constraints
Hi. My name is Antonio Goncalves, and I want to welcome you to this module about Bean Validation Built-in Constraints and how we validate them. In this module, I will show you what are the common constraints that are bundled with Bean Validation. Constraints are annotation that we use at development time. On the other hand, validation happens on the runtime and uses a set of API to achieve this. I will then show you how to use all these in Java SE and with unit tests.

Defining our own Constraints
Hi. My name is Antonio Goncalves, and I want to welcome you to this fourth module that explains how to define your own constraints with Bean Validation. Bean Validation provides standard built-in constraints such as null, not null, max, min, but they cannot meet all our application needs. Therefore, the API allows us to build our own business constraints easily with annotations. Then there are several ways to implement the validation algorithm either by aggregating existing constraints or writing one entirely from scratch.

Messages, Groups and Payloads
Hi. My name is Antonio Goncalves, and I want to welcome you to this fifth module that goes further into defining and customizing your own constraints with Bean Validation. In both cases of constraint composition and generated constraints you can customize error messages. They can be hard coded, use resource bundles, and be internationalized. Partial validation can be achieved by defining groups and validating certain groups. Payloads will wrap up this module.

Advanced Topics
Hi. My name is Antonio Goncalves, and I want to welcome you to this module that covers some Bean Validation Advanced Topics. In this module, you will learn how to add multiple constraints on the same target. So far we've seen outer constraint attributes, but with Bean Validation we can also constrain classes or methods and even trigger this validation automatically. On top of validating an entire bean, we can also validate single properties or even values. Then we will see how to deal with constraint inheritance, and we'll finish this module with XML configuration.

Bean Validation 1.1 within Java EE 7
Hi. My name is Antonio Goncalves, and I want to welcome you to this last module that covers integration between Bean Validation 1. 1 and Java EE 7. In this module, I will give you a very quick overview of Java EE 7 trying to focus on the services given by the Java EE container to Bean Validation. You will see how Bean Validation is deeply integrated with some specifications such as context and dependency injection, Java Server Faces, Enterprise Java Beans, Java Persistence APA, and REST's Web Services. I will finish this module with a summary of the course and will give you some extra pointers for external references.