my table has 3 columns: ID, City, District.
My web service give in input a list of couples (City, District). I need to avoid couples (City, District) duplicates.
How can I achieve this result? I can't use session.saveOrUpdate() because due to a different ID, all the records seems always different.
Please help me.
Thank you.
CONSTRAINT city_district_unique UNIQUE (city, district). The exact syntax will vary depending on the database you're using.