As soon as you have to implement business logic or objects which should be persisted, the implementation should be done in the model. Note that the default implementation of this layer is implemented in Play with the use of JPA, Hibernate, and an SQL database in the background. However, you can of course implement an arbitrary persistence layer if you want.
Any model you define should go into the models package, which resides in the
As in the recipes before, this was already a reference to a user entity. It is the right time to create one now. Store this in the file
package models; import javax.persistence.Entity; import play.data.validation.Email; import ...