1
I need to check in the database if the information that the user is trying to enter already exists, for example:
In the registration of a company, I cannot allow the same CNPJ for others. I am doing in JSF 2 with JPA2 Hibernate. I made an example of video lesson of Algawors, but there did not show this treatment.
At the bank, you can register the CNPJ as the primary key.
– Jean Gustavo Prates
Welcome to Stackoverflow! Please explain the problem better, and if possible include a example of code that reproduces what is happening, because your question is too wide. See Help Center How to Ask.
– Marciano.Andrade
You can use your field as Constraint. Take a look there. http://www.w3schools.com/sql/sql_constraints.asp
– Marconi