Is there a way to generate Code from a DB in Java Play 2 Framework?

。_饼干妹妹 提交于 2019-12-22 09:19:29

问题


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?


回答1:


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.




回答2:


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:


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



来源:https://stackoverflow.com/questions/10403042/is-there-a-way-to-generate-code-from-a-db-in-java-play-2-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!