How to generate Spring WebMVC CRUD API

前端 未结 5 1234
失恋的感觉
失恋的感觉 2021-01-01 03:58

What I want to do is to create a full Spring WebMVC CRUD API from database tables/Hibernate JPA entities, into an existing Maven Web Project. What I want generate, to be pre

5条回答
  •  余生分开走
    2021-01-01 04:44

    Spring-roo (link) have these features, and if you want you can remove spring-roo from your project and remains a java-spring project.

    Sample from link :

    roo> hint
    roo> project --topLevelPackage com.foo
    roo> jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY         
    roo> entity jpa --class ~.Timer --testAutomatically
    roo> field string --fieldName message --notNull
    roo> hint web mvc
    roo> web mvc setup
    roo> web mvc all --package ~.web
    roo> selenium test --controller ~.web.TimerController
    roo> web gwt setup
    roo> web gwt all --proxyPackage ~.client.proxy --requestPackage ~.client.request          
    roo> perform tests
    roo> quit
    

    As you can see : create the project, setup jpa provider, create Entity, create MVC Controller, the Tests and some GWT setup.

提交回复
热议问题