Check email property for existed.

How to make entity property like email to be checked if already exist?
I am using mySql database.

Does you entity class implement the SoftDelete interface? If so, then you’ll have to take a look at the following section of the documentation: https://doc.cuba-platform.com/manual-6.4/db_mysql_features.html

The only thing you have to additionally know is that Studio may try to remove the unique index you created:


create unique index IDX_DEMO_CUSTOMER_UNIQ_NAME on DEMO_CUSTOMER (NAME, DELETE_TS_NN)

To avoid this either exclude the DB script that removes this index, or start the index name not with the ‘IDX_’ prefix.