Generate entity classes from DB
By pavel on Jan 26, 2006
The last entry was about auto generation of DB tables for entity classes in Glassfish. Now, in turn, we have something cool to show you in NetBeans JavaEE 5 build. We have implemented a wizard that generates entity classes from existing database tables. The generator calculates closure of tables based on foreign keys. It generates nice Java friendly names, for example if the database has "CUSTOMER_ID" it will use getCustomerId() for the getter and uses mapping annotations, e.g. @Column(name = "CUSTOMER_ID", nullable = false). It also generates annotations for all relationships, etc.
A picture is worth thousand words:
Get a build of Java EE 5 (see the link in the up right corner) and test it on your database. Send feedback or file bugz. Thanks.