Yes you can but you must not extend JPAModel as it provides a default
Long, generated id.
You can either use the hibernate UUID generator (outside of the JPA spec) :
package models;
import javax.persistence.*;
import org.hibernate.annotations.*;
import play.db.jpa.*;
@javax.persistence.Entity
public class User extends JPASupport {
@Id
@GeneratedValue(generator="system-uuid")
@GenericGenerator(name="system-uuid", strategy = "uuid")
public String id;
}
or let your application manage the identifiers without using any
@GeneratedValue annotation...
You can use play.libs.Codec.UUID() to generate unique identifiers.