Community contributed extensions

Since v2.0.0, the project is hosted by Github play-crud-siena under MIT license

CRUD Siena Play! v2.x

NEW v2.0.2 depends on play-siena v2.0.4+siena-1.0.0-b6 & provides GAE Native Embedding & corrects bug in YAML loading of models with @Id field not named “id” and YAML loading of related entities

Release notes

IMPORTANT The main difference to know is that now SienaSupport class has been removed completely as the Siena Crud manages any Siena Class if there is a Controller for it.

Note v1.x only supported GAE but this is not the case anymore. Other NoSQL Databases will be added later.

Enable Crud Siena support

Install Siena module

play install siena

Install CrudSiena module

play install crudsiena

Add CrudSiena module to your dependencies

In your /conf/dependencies.yml file, enable the CrudSiena module by adding these lines:

require:
    - play -> play [1.2.1,)
    - play -> crudsiena [2.0.0,)
    

Siena module is brought by transitivity through crudsiena
We ensure that you have at least Play 1.2.1.

IMPORTANT Do not add default crud dependency, it would collide with Siena Crud.

Configure your database

For this, please refer to Siena module

Provide a simple Siena model

IMPORTANT you don’t need to extend SienaSupport anymore.

For example:

@Table("employees")
public class Employee extends Model {

        @Id(Generator.AUTO_INCREMENT)
        public Long id; 

        @Column("first_name")
        @Max(100) @NotNull
        public String firstName;      
  
        ...
}


For more information about Siena Model, please refer to Siena module

Create a CRUD controller inheriting class CRUD

For each Siena entity requiring CRUD support, create a controller.
You just have to annotate your controller with @For(ModelClass).

For example:

@For(models.Employee.class)
public class Employees extends controllers.CRUD {
}

Enable routes to the CRUD module

At the beginning of your conf/routes file, add:

*    /admin    module:crudsiena

Play Validation with Siena annotations

These are Siena model Annotations managed by the CrudSiena module:

Play Validation with Play annotations

These are Play Annotations managed by the CrudSiena module:

Specific CrudSiena annotations

(thanks to Spreiter301 for his contribution... see googlecode issue)
Be careful this annotation calls DB requests that can be quite heavy so it might impact your application performance. (I will try to provide a mechanism to control where this annotation is applied but it is not so trivial)

Known limitations

This is the first version and issues will be found for sure.
So don’t hesitate to tell me about it or to open issues on github project