mandubian/play-siena — pull request #7 by dwursteisen (2011-12-15 22:49:51+00:00)
Title: NPE when Siena plugins bind an object with an @Id field, and an id which doesn't exist in the database.

The Play siena plugins throw a NullPointerException when Play try to bind an Siena model with the id field into the HTTP request.

if the id doesn't exist into the database, the plugins throw a NullPointerException.

To reproduce the problem
-------------------------------------

Create a simple Model object with an id field.

public class MyObject extends Model {
@Id public Long id;
}

in a play functional test, call a controller method with your object as parameter

// controller
public static void index(MyObject obj) { // ... }

// functional test
Map httpParams = new HashMap();
httpParams.put("obj.id", "0"); // auto increment field start at 1, not 0

it should lead to a NullPointerException.