Sunday, May 16, 2010
I realize that it was a pretty long time that I haven't blogged.
So, you tell me, what's up?
First of all, our Play! talk has been accepted to JavaOne. So Guillaume and I will be speaking in the biggest Java conference ever. We will try to do our best to convert fellow Java developers to try out Play!. Once you tried it, you are addicted so our job is actually easier than other framework ;)
Second, I have just released a new module that I think is really useful (actually I hesitated to provide the functionality per default in Play! so you don't have to enable the module):
* play db:export will generate a sql script to create your database based on your actual object model
* play db:import will import your database table into your domain model (so it generates java files that extends JPASupport)
It is necessary to enable the module and to configure your database connection in the application.conf file. I think that is pretty simple and that is why it is Play! "compatible".
There are plenty of options for the db:output command, but you need the latest play! version (so play! > 18.104.22.168).
The next step for this module will be to generate diff between the database and the object model automatically.
The obvious next step will then be to merge this module and the DB migrate module. David feel free to fork my module or to contact me ;)
In term of POJO generation, it would also be nice if this module could generates the CRUD controller if asked for. Another feature would be to generate the object model as scala objects.
Under the hood the module uses a modified hibernate tools (so it works with Hibernate 3.5). Hibernate tools uses freemarker to generate files, so I had to modified those as well. I will publish all the sources shortly.
As usual, please report all the bugs on http://github.com/pepite/play--database . Contribution and help are more than welcome :)
And so you know, we are working hard to make play! 1.1 the framework that will allow java developers to be the best web developers. I am currently working on a new binding mechanism where JSON is a first class citizen. More about this subject later...