Custom Object Binder for Model Object

68 views
Skip to first unread message

Allen

unread,
Jul 3, 2012, 3:26:30 PM7/3/12
to play-fr...@googlegroups.com
Hi,

I want to use the Apache Cayenne Framework as ORM in a play application.
Like in play 1.x I want to automatically bind a post request to model object.

How can I dig into the binding process and can do:
- if a id is given in the form, fetch directly the model from the db and fill-in the form data
- if a id is not given, create a new model object and fill- in the form data

Also, is there for play2 a central place where all modules are listed?

Best,
Allen

Allen

unread,
Jul 3, 2012, 3:27:59 PM7/3/12
to play-fr...@googlegroups.com
did forget: its a play 2.0.2 app where I need this.

Nilanjan

unread,
Jul 3, 2012, 11:31:34 PM7/3/12
to play-fr...@googlegroups.com
for modules you can checkout the following wiki page:

https://github.com/playframework/Play20/wiki/Modules

And for the request binding I would start at Form.bindFromRequest and see how to create a Form object

http://www.playframework.org/documentation/api/2.0.1/scala/index.html#play.api.data.Form

HTH
Nilanjan
Reply all
Reply to author
Forward
0 new messages