Java persistence code generation tools

Java DAO generators review

I need DAO generator (tool for persistence code generation). For what? I have third party application with database backend and I want to write my own application for insert/browse data to/in database. So i need framework that can create whole application or possible only DAO level from database schema. I prefer more less official things like Spring and Hibernate rather than iBatis, Cayenne or what else? I want to find entire framework that need minimum configuration, simple and quick to start to work with but eclipse plugin can also be accepted if it good and simple. So i tried to google with requests like “java dao generator” and “java persistence generator” and what i found so far:

FireStorm — framework, that can produce DAO level or whole application using several persistence technologies like Hibernate, JPA, Spring JDBC etc. It is not free, but may be evaluation
version will be enough   for me;

DaoGen — online DAO code generation tool that can produce DAO code in Java and PHP; // curious: impossible to upload schema table details must be inserted manually.

MDAOG — java application with Swing UI that generates DAO in Java but only for Postgres database;

Hibernate Tools — can be used standalone via Ant or as Eclipse plugin;

EclipseLink — universal java persistence tool. Even at first glance seems to be too complex.

HiberObjects — is a UML tool for programmers, especially suited for Hibernate, JPA, GWT and Grails.

Netbeans — probably the best Java IDE that has built in persistence support.

I started from Netbeans that is quite naturally. I have Netbeans already installed so i need nothing else to start. In short, i must to say that i found what i need with this first attempt. If you already use Netbeans for development don’t read the rest of this article. Instead go to Netbeans Help, search for database reverse engineering and you will found all necessary info how to generate java code from database.  But to be honest i now will make really short review of above tools and finally will make step-by-step example how to create whole java application from database schema using Netbeans.

FireStorm.

Pros:

– possibility to generate different kinds of code including whole j2ee application;
– IDE is simple and intuitively understandable;

Contras:

– generated code must be imported to some java IDE like Netbeans or Eclipse for further maintenance;
– IDE is not so comfortable (for example full url must be provided for database connection instead of host and port);
– not free, very expensive, evaluation version is limited for some number of code generations;


DaoGen.

Pros:

– online tool, no downloads and installation is needed;

Contras:

– database table data must be entered manually, that makes it something like curious online application example rather than really useful tool.

MDAOG

Contras:

– it works only with PostGres, so  sorry to waste time.

HibernateTools

Contras:

– very hard to install and start to work with: on my eclipse installation after i installed HibernateTools (simply extracted features and plugins to eclipse folder) nothing appears in the menu. I understand that i need wtp plugin   but did not succeed to download and install it. After 20 minutes of trying i leave this attempts to people loved eclipse. I really not understand how this tool (eclipse i mean) became standard IDE in java development. I never will understand why plugins must be under Help and many other things.

EclipseLink

Pros:

– seems to be (if believe to project description) very powerful;

Contras:

– complex to start and use. After several minutes of trying to find getting started chapter of user guide i left it for eclipse lovers;
– user guide is not understandable;
– is not a plugin but standalone IDE;

HiberObjects

Contras:

– using UML as basis for developing application. For me it’s enough  that never use it.

Netbeans

So, finally, i come back to Netbeans. I must to say that i not use it a lot for java development. But using php package i discovered that Netbeans has the best javascript and css editors i ever seen. Jsp editor also better than eclipse one. Memory and processor time usage  less than in eclipse. I plan full migration from eclipse to Netbeans soon.
So, about database reverse engineering. It’s so simple as it must be. I assumed that you have Netbeans (java package) installed and java project is created.
Now go to New File :

choose Persistence and now the first step is Entity Classes from Database and next JPA Controller Classes from Entity Classes. Just follow wizards — very heavily to lost. You will be asked for your database details. As result, you get for each table in your schema: java entity (domain model) class with JPA annotations and controller class with CRUD and finders methods.
As you can see on above image there is also Hibernate category, but as i understood only POJO classes can be created without controllers/DAO tier.
So, how to create whole application? Make only first step (create Entity Classes) make irreparable improvements and then use OpenXava to produce your own web application.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • RSS
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz
  • BlinkList
  • blogmarks
  • DZone
  • E-mail this story to a friend!
  • LinkaGoGo
  • Live
  • MisterWong
  • MisterWong.DE
  • Reddit
  • StumbleUpon
  • Technorati
  • ThisNext
  • Tumblr

Related posts:

  1. Sequence of learning Java programming
  2. Java Domain Driven Frameworks review
  3. What java framework(s) to use for web application programming?
  4. Java vs Ruby
  5. How to start desktop application with Netbeans

Leave a Reply


wordpress seo