1) You can define a unique constraint with @Column( unique=true )... There are also constraint annotations (Annotations Reference Guide Chapter 3) but there are none that annotate 'Unique'.
2) From what I understand, Hibernate does not use hashCode and equals when inserting records in a database ( see
http://www.hibernate.org/109.html ). Hibernate looks at what you have listed as an id and checks if that is already in the table, if not then it will add it.
If you have a composite primary key set or if you make a column unique in your table schema then Hibernate will throw an Exception and not insert the record if it is violated. You can catch this Exception and deal with it however you would like.
-B
___________________________________
Please rate me if you found my post useful.