views:

257

answers:

5

Are there any Java code generation persistence frameworks? Something that is "database first" rather than object model first? I know this is probably heresy in the Java world, I'd just like to know if any frameworks like this exist.

I'm more of a .NET guy these days. So on the .NET-side tools like .NET Tiers or CSLA come to mind.

+2  A: 

sure, hibernate and netbeans for example can reverse engineering a database. You may be want to look at:

  • Hibernate Tools; site in maintenance
  • netbeans, with recent version of netbeans you can create JPA entities from a JDBC connection

My 2 cents.

dfa
MyEclipse has the Hibernate reverse engineer functionality built in. Might be a quick way to start.
Thorbjørn Ravn Andersen
A: 

Many of the Java-based persistence tools include tools to generate code based upon an existing schema. Netbeans will generate JPA (including Session bean facades, if desired). Similarly, JBoss Tools for Eclipse will generate Hibernate JavaBeans for you based upon an existing schema.

jsight
+1  A: 

Checkout EclipseLink project ( plugins for eclipse) , you can generate JPA models from database tables

Surya
+1  A: 

The Apache Cayenne ORM framework is able to reverse engineer a database. See here.

Markus Lux
A: 

I would recommend HiberObjects. It's an Eclipse plugin that can be used to model persistent objects or reverse engineer an existing database. The way it lets you set up unit tests is truly awesome. You can also modify how for instance DAO classes are generated: just modify a Groovy script and all DAO-classes are re-generated. I have encountered a few bugs, but the guy behind it has been very responsive and released fixes in short time. A description and user ratings/comments are found at Eclipse Plugin Central.

nawroth