This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

ECLIPSE Plugin for automatic CRUD code generation

 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • 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: 22276
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic