views:

995

answers:

2

I'm attempting to learn Spring MVC but have been spoiled by Grails. While I am able to get a basic web application working I was wondering if there were any tools that could do some of the work to create a crud application given a database or hibernate data model? The only one I've found so far is http://www.skywayperspectives.org/portal/web/guest/downloads/overview I'm not sure how to take the generated code and convert it to use either maven or ant for it's build process.

+1  A: 

I've never tried it but it looks like the Appfuse Maven Plugin (AMP) allows you to do this via Maven. There's a mvn appfuse:gen-model command to reverse engineer from a database and mvn appfuse:gen to create the rest of the scaffold.

I think you have to run these from within a project created with one of the Appfuse Maven archetypes. You can find the quickstart guide here to set that up.

Spring Roo has some nice scaffolding too, but it doesn't have the reverse engineering from the database you're looking for yet. Your persistence objects need to be annotated as @RooEntity objects before you can take advantage of the scaffolding with that framework.

Jason Gritman
I can't get the generate command to work in App Fuse but have looked at Spring Roo. I've decided to use Spring Roo, my database is simple enough that i can manually create all the necessary entities. I really like Spring Roo, although I don't know if I'd use it for a production app yet since it still appears to be lacking good documentation but I assume this will be fixed in the 1.0 release. Also database reverse engineering is listed as a high priority feature request.
Jared
A: 

I have made the same search. Finally had a look at JBoss Seam. Seam appears to have a database schema import and generates the necessary backend and frontend code. Spring Roo seams to be very similar to JBoss Seam, just that Seam is longer there and more mature.

Thomas Letsch