Is there a CRUD generator utility in Java(any framework) like Scaffolding in Rails?

JavaRuby on-RailsCrudScaffolding

Java Problem Overview


Is there a CRUD generator utility in Java like Scaffolding in Rails? Can be in any framework or even plain servlets. Must generate controllers + views in jsp, not just DAO code...

Java Solutions


Solution 1 - Java

Spring Roo seems to be exactly what you're looking for: CRUD code generation, spits out pure Java code that can be made tun run entirely independant from the framework.

Solution 2 - Java

Grails has scaffolding.

Solution 3 - Java

See the Telosys Tools Eclipse plugin at http://www.telosys.org/

The plugin connects to the database, generates a lightweight repository, lets you customize the repository if necessary and generates Java Beans, DAO, XML converters, ScreenMaps (JSP) etc...

You can build a Data Centric Web App in few minutes

Solution 4 - Java

Use JHipster. It is built on the popular front end scaffolding tool 'yeoman'. It not only generates your back end including controllers, dao, security, user management, system and API metrics, logging etc using Spring Boot & Spring MVC 4, but also generates your front end using angular js. You also get goodies like grunt, karma and bower fully setup and ready to use! Along with this you also get database versioning!

It also has sub generators for generating domain entities which generates your java and corresponding front end for managing it's data.

It takes 10 mins to get a full webapp running.

Solution 5 - Java

JBoss Seam has a scripting utility called seam-gen that will create scaffolding:

http://docs.jboss.org/seam/1.1BETA2/reference/en/html/gettingstarted.html

Solution 6 - Java

http://appfuse.org/display/APF/Home">AppFuse</a>;.

It is very powerful, perhaps it will be too powerful for the task in question, but it does it well.

Solution 7 - Java

I came across this question and tried many suggested answers. In the end, I found Lightadmin. It does not generate CRUD code, but provides a nice front end to Entity classes with very little code. To make the User entity available through the Lightadmin web interface, it only needs two changes in the XML files and then a UserAdministration class:

public class UserAdministration extends AdministrationConfiguration<User> {
    /* empty */
}

You can configure the field names (and probably much more) in this Administration class, but I find it already very useful without any further configuration. The Getting Started guide really shows how easy it is. After these simple steps you can open the admin interface over http://localhost:8080/TestApp/admin.

Solution 8 - Java

Netbeans has something like this.

There's a demo here: http://www.netbeans.org/kb/55/persistence-demo.html

Solution 9 - Java

There's http://code.google.com/p/krank/">krank</a> on Google Code. I haven't tried it yet, but it looks promising.

Solution 10 - Java

It might be a bit out of context, but for Java EE, there is Jboss Forge. There is an example that uses it.

Solution 11 - Java

Have a look at tools like:

MetaWidget http://www.metawidget.org/

ISIS http://incubator.apache.org/isis/index.html (previously Naked Objects)

They generate UI's "on-the-fly" but allow you to customise the UI when necessary.

Much better than code generation.

Solution 12 - Java

Have a look at Minuteproject

And try it's demos.

Regarding technologies

If you look for just ORM + DAO try the track BSLA-JPA2 (BSLA meaning Basic Spring Layer Architecture). It promotes mask pattern to ease search.

If you want Active record oriented persistence look at JOOQ or Roo

If you want servlets look at minuteproject 4 Openxava or 4 Primefaces

If you want portlets look at Liferay Service builder minuteproject will generate service.xml input from your DB.

Regarding your model

If you want that your code (java) follows java convention and not DB convention use minuteproject. It has enrichment facilities that allows to:

  • Package entities (table/view)
  • Apply entity/field naming conventions
  • Apply stereotypes/constraints/validations
  • retrieve relationships (one2many, many2one, many2many) if foreign keys are missing ex here
  • And many more

This enrichment can be applied individually at field/entity/package or globally via conventions (So you configure your own conventions).

Solution 13 - Java

Since the question was asked, there are several frameworks for Java that came out. Check out Spring Roo, and Play Framework. There is also Skyway Builder, which I think predates both.

Solution 14 - Java

Check out Tynamo

Solution 15 - Java

NetBeans can generate CRUD for existing database in JSF.

What about OpenXava http://openxava.org ?

Solution 16 - Java

Try Grails at http://www.grails.org/

Solution 17 - Java

See Jspresso - http://www.jspresso.org/
It features multiple front-ends (Flex, pure HTML/Javascript, Swing, etc) but it does not give you much freedom on the view part. It's worth checking though.

Solution 18 - Java

Do not forget Play. Extramely easy to use. Once you have experience in ruby on rails it will be easy for you to adapt in Java too..

Solution 19 - Java

give a try to generjee

It generates CRUD and provides you backend along with frontend using specs like JPA, EJB, JSF framework using primefaces, java security, authentication, auditing, excel and pdf exporting, user management, user registration.

Afterward you can download the source code or deploy to heroku. I've tested it and it gave me expected results

Solution 20 - Java

Solution 21 - Java

reinCRUD is a vaadin add-on which works using annotated hibernate entities. You can create a CRUD application within a few minutes and you can re-use components like lists, forms and search forms.

Solution 22 - Java

If you have an example project containing the kind of CRUD (or whatever) architecture you want, then Simple Scaffolding might be a useful approach.

It's a single class that scans your existing code base and creates templates which you can then apply to other entities. For example, MongoUserDao can be turned into a template which then generates, say, MongoCustomerDao. It works with any code and test fixtures.

Very basic, but gets the job done and it's FOSS under MIT license.

The GitHub repo is here: https://github.com/gary-rowe/SimpleScaffolding

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSathishView Question on Stackoverflow
Solution 1 - JavaMichael BorgwardtView Answer on Stackoverflow
Solution 2 - JavaHates_View Answer on Stackoverflow
Solution 3 - JavaJ Thomson View Answer on Stackoverflow
Solution 4 - JavaVarun AcharView Answer on Stackoverflow
Solution 5 - JavaMatt SidesingerView Answer on Stackoverflow
Solution 6 - JavaBozhoView Answer on Stackoverflow
Solution 7 - JavaBenedikt KöppelView Answer on Stackoverflow
Solution 8 - JavaSarel BothaView Answer on Stackoverflow
Solution 9 - JavaAdam JaskiewiczView Answer on Stackoverflow
Solution 10 - JavajacktradesView Answer on Stackoverflow
Solution 11 - JavaNoel GrandinView Answer on Stackoverflow
Solution 12 - JavaxflorianView Answer on Stackoverflow
Solution 13 - JavaJean BarmashView Answer on Stackoverflow
Solution 14 - JavaKalleView Answer on Stackoverflow
Solution 15 - JavaAndreyView Answer on Stackoverflow
Solution 16 - JavaAzizasmView Answer on Stackoverflow
Solution 17 - Javauser246645View Answer on Stackoverflow
Solution 18 - JavatakacsotView Answer on Stackoverflow
Solution 19 - Javadaniel rubamburaView Answer on Stackoverflow
Solution 20 - JavaOscarRyzView Answer on Stackoverflow
Solution 21 - JavaFlorianView Answer on Stackoverflow
Solution 22 - JavaGary RoweView Answer on Stackoverflow