You would need to create an index in your entity, add the column or combination of columns that you would like to be unique (adding them as indexcols to the index), and set unique=true in the properties of the index.