title: Custom annotation to validate unique elements
body: <p>I need to write custom annotation for UniqueElements. I know Hibernate provides one of these, but I need to validate by just one parameter (so can not use hashCode).</p>
  
  <p>I have something like this:</p>
  
  <pre><code>@CustomAnnotatinon
  List&lt;MyParameter&gt; parameters;
  </code></pre>
  
  <p>Lets say MyParameter have id, value and type, but I have to validate unique elements only by id. Can somebody please help me?</p>