When you create a form, each field initially displays the value of the corresponding property of the form's domain data (e.g. If you want to override this initial value for the form or an individual field, you can set it in the data option: overrides the value taken from the domain data (object) when rendering.
This means the object value is also overriden when the form edits an already persisted object, causing it to lose it's persisted value when the form is submitted.
Data integrity is best handled by the database itself.
For example, if you have a date column that should never contain a NULL value, the column should be specified in the database as NOT NULL.
If you have an integer column that should only have values from 1 to 10, there should be a CHECK constraint that ensures that the value of that column is between 1 and 10.
And if you have a varchar column where the length of the entries should be between 2 and 255, you should be setting the size of the varchar column to 255, and using a CHECK constraint to ensure that all values have at least two characters.
But what if the data source for your insert statement is a staging table that was populated by an ETL job or a series of values from a web form?
Panic over - Database 12c Release 2 contains important changes to the functions to manage the most common data conversion errors.To set up the project itself you can make the project manually, or you can use the online Initializr wizard.If you’re using Initializr, make sure you check Web, JPA and HSQLDB because I will be using those to demonstrate how to validate the input of a REST API.Doesn’t matter who much testing you do (well, it actually does but that’s a whole different issue) you can almost guarantee that at some point your beautiful data validation code, that parses data input from a web form or loads data from some external file, will pop up with the error: ) What’s to do?Of course the sensible thing is to add lots of data validation checks into your code to try and catch the situations where the wrong type of data arrives from your data source.In the next few weeks I will be writing a small web application and in these articles I’m going to explain certain aspects of it.