title: How to convert class to persistent entity in hibernate with composite key
body: <p>I have class named 'User'
  it having following properties</p>
  
  <pre><code>firstname
  lastname
  mobile
  email
  pin
  </code></pre>
  
  <p>I want module it to persistance entity with following constraint mobile and email will be unique for each user and atmost one of them will be null.I should be able to fetch record with email,with mobile and both email and mobile. Can it be possible using single persitence entity or i should divide this into two?</p>