Is there a way to generate Code from a DB in Java

2019-05-09 18:32发布

Does anyone know how to easily generate code from a database in Play Framework 2.0??

I know they have a module but it seems this is for version 1.X.

Anyone?

3条回答
家丑人穷心不美
2楼-- · 2019-05-09 19:13

Your question has 2 aspects:

  1. Create all models, base on a database. There you can start with the jpa-generator for play 1.x, because ebean use JPA too. It should be nearly what you need. Another approach is reverse engineering from ebean-models from database. But I fear this doesn't work. At minuteproject I find no example. How ever Ebean and JPA-Model are very similar.

  2. Creating GUI from DB-Model named scaffolding or crud. Some guys working on it and found some bugs in play 2.0. So I fear it will take some month till you get something like CRUD.

查看更多
劳资没心,怎么记你
3楼-- · 2019-05-09 19:33

The CRUD module is only for Play 1.2.x, it's not available in Play 2.0. It MAY be available in Play 2.1, but I'm not sure if that's still on the roadmap.

查看更多
The star\"
4楼-- · 2019-05-09 19:33

Short Answer Is no, this Is module Is not developed Yet In play! 2.0 But I'd snuggest working from java object to DB In play It is very easy. ebeans realy simplify the ORM work. https://github.com/playframework/Play20/wiki/JavaDatabase

查看更多
登录 后发表回答