title: PersistenceException occured : org.hibernate.exception.ConstraintViolationException: could not insert: [models.User]
body: <p>I have got this exception!!
  here is my model class</p>
  
  <pre><code>@Entity
  public class User extends Model {
  
      @OneToMany(mappedBy="email", cascade=CascadeType.ALL)
      public List&lt;Photo&gt; photo;
  
      @Email
      @Required
      @Unique
      public String email;
  
      @Required
      public String passwordHash;
  
      @Required
      public String education;
  
      @Required
      public String fname;
  
      @Required
      public String lname;
  
      @Required
      public Date dob;
  
      @Required
      public String gender;
  
      @Required
      public String country;
  
      @Required
      public Long phone;
  
      @Required
      public String status;
  
      @Required
      public String jobtitle;
  
      @Required
      public String company;
  
      @Required
      public String industry;
  
      @Required
      public Date addDate;
  
      public String needConfirmation;
  
  public User(String email, String password, String fname,
                  String lname, Date dob, String gender, String country,
                  Long phone, String status, String education, String jobtitle, String company, String industry) {
          //all initialization here
      }
  }
  </code></pre>
  
  <p>can you please tell me where I am going wrong
  playframework× 2289</p>
  
  <hr>
  
  <pre><code>this is my photo class, and please tell me how can I allow JPA to generate my database
  
  
  /*
   * To change this template, choose Tools | Templates
   * and open the template in the editor.
   */
  package models;
  
  import controllers.Users;
  import javax.persistence.Entity;
  import javax.persistence.ManyToOne;
  import play.db.jpa.Model;
  
  /**
   *
   * @author nPandey
   */
  @Entity
  public class Photo extends Model{
  
      public String photoname;
  
      @ManyToOne
      public User email;
  
      public String owner;
  
      public Photo(){
  
      }
  
      public Photo(User email, String photo){
          this.photoname=photo;
          this.email=email;
          this.owner=email.email;
      }
  
  }
  </code></pre>