title: How do I implement User validations in Play!?
body: <p>I have a User model, the scheme for which looks like this:</p>
  
  <pre><code># --- First database schema
  
  # --- !Ups
  
  create sequence s_user_id;
  
  create table user (
    id  bigint DEFAULT nextval('s_user_id'),
    firstName  varchar(128),
    lastName  varchar(128),
    email  varchar(128) unique
  );
  
  
  # --- !Downs
  
  drop table user;
  drop sequence s_user_id;
  </code></pre>
  
  <p>How can I validate the new users instead of just crashing with a </p>
  
  <blockquote>
    <p>RuntimeException: Exception while executing statement : Unique index
    or primary key violation:</p>
  </blockquote>
  
  <p>?</p>
  
  <p>Also, I'm not using any forms or views of any kind. I'm just creating an API...</p>