• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ECLIPSE Plugin for automatic CRUD code generation

 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I�m looking for a plugin that is able to generate the default CRUD operations for web application, preferable using JSF/Hibernate, maybe spring.

I couldn�t find anything so far . Any suggestions will be appreciated!
[ October 31, 2006: Message edited by: Marcos Maia ]
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the club. It's not that no one does them, but every one I find seems to either require a complex pre-setup operation or won't work with the tools/environment I'm in or something equally show-stopping.

I do have something that works and is fairly easy to set up - at the risk of blowing my own horn. http://www.mousetech.com/EJBWizard.html .

The tool is called the EJB Wizard, but that's sort of misleading. It's a GUI attached to a dictionary that drives a template-driven macro processor augmented by a JDBC metadata reader. It was originally designed to create CRUD and EJBs for the JOnAS container system, but was expanded over the years. The basic template set builds EJB1.1 components, but I have a template set for EJB2 that I used to build a website several years back, and have bits and pieces of a template set for Hibernate persistence (with an option for JPA). I've used it to build Struts CRUD and more recently for JSF.

Although the latest production release was created with the idea that it would be usable in an Eclipse plugin, I never got that far. As it exists presently, it runs as a standalone Java application. You should be able to invoke it as an external tool.

Setup is easy enough. Unzip the binary project, set a few environment variables, customize the startup script to find your favorite JDBC drivers, and add datasource config files as needed. For custom code generation, the template language is easy to understand, and you can add, modify or remove templates as needed - even setup per-project templates.

It hasn't been updated in about 3 years, but it hasn't suffered from it. I've a 4.0 release under slow construction, but basically it's just a decoupled version that will allow me to run the process headless so I can mass-process database tables into my ORM poison of choice.

It can do top-down, bottom-up or meet in the middle. By reading in JDBC metadata, you can construct field definitions from an existing table. Or you can enter them all in from scratch. OR create a new table definition modelled on an existing table. Etc. One of the things that the standard template set spits out is the SQL DDL required to define the table.

When I was using it on a major project, I typically went from start to finish at an average of 4 hours per table - mostly prettying up the edit forms. This tool only works on one table at a time, but the parent/child stuff I did wasn't too hard to do by stealing pieces of single-table code.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic