Try mo mag execute ng select query. Sa criteria lagay mo yung mga data na gusto mo e-insert. If the query returns 1 or more than 0 results, then the record you are trying to add already exists. Paste mo dito select query na ginagawa mo madala sa java.