Awesome Open Source
Awesome Open Source


Join the chat at

Powerful CRUD & DAO implementation with REST interface for play framework 2.x

For the Typesafe Activator check play2-crud-activator.

Some screenshots

  • index page crud-index page

  • create page create page

  • list page list page

Quick Start

Follow these steps to use play2-crud. You can also use it partially just for DAO or CRUD controllers. If you think any part needs further explanation, please report a new issue.

Add play2-crud dependency

You can begin with adding play2-crud dependency inside conf/Build.scala file.

  • Add app dependency:
    val appDependencies = Seq(
        javaCore, javaJdbc, javaEbean,
        "play2-crud" % "play2-crud_2.10" % "0.7.0"

  • Dependency version is for version 0.7.0 defined, but you can use the latest version.

  • Add custom maven repositories:

    val main = play.Project(appName, appVersion, appDependencies).settings(
        //maven repository
        resolvers += "release repository" at  "",
        resolvers += "snapshot repository" at ""

Associate Global settings

Direct reference

If you don't want to override the play application launcher, you just have to notice to play that the class to use as launcher is now GlobalCRUDSettings. Change the configuration key in the conf/application.conf file, and use play.utils.crud.GlobalCRUDSettings:


Define routes

# CRUD Controllers
->     /app             play.crud.Routes

->     /api   

Define model

  • Model class has to implement play.utils.dao.BasicModel with the type parameter indicating the type of the @Id field.
public class Sample extends Model implements BasicModel<Long> {

   private Long key;

   private String name;

   public Long getKey() {
      return key;

   public void setKey(Long key) {
      this.key = key;

   public String getName() {
      return name;

   public void setName(String name) { = name;
  • Here the Sample model class implements BasicModel<Long> where key field indicated with @Id is Long.

... call http://localhost:9000/app and voila!



Here you can find some HOW-TO documents introducing some powerful functionality:

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
java (30,358
crud (127
playframework (40
play-framework (36
dao (17

Find Open Source By Browsing 7,000 Topics Across 59 Categories