Please use the google group to ask questions - thanks.

by Rob 14 May 08:17
Schema generation vs DB Design/Generation tools

From Christian...

Looks like Ebean can't generate the database schema from the pojos and their mapping?
I'd really like that feature - It allows you to move forward at faster


You are quite right Christian, Ebean doesn't currently generate the database schema. It is probably worth noting that I'll need a bit more 'proding' to get motivated to do this, in that I'm currently not a big fan of this approach (generating DDL from annotated Entity Beans). Perhaps you can change my mind?

The reason I'm not a fan is several fold:
- I personally want to use the same development techniques for all apps (big and small)
- I don't think generating DDL from annotated beans will work well for big projects
- DDL specific to Databases such as Oracle/DB2 (Tablespaces etc)
- How to ensure consistent DB types (precision/size)
- I LIKE Entity Relationship/Database Design Tools (I personally choose to use Case Studio)
They provide great features (sub models, DB specific DDL, versions, diagrams, quality DDL generation, documentation)

Its interesting that you note the reason for generating DDL from Entity beans as development speed. Thats fair enough, but I'd be interested to know how you created the Entity Beans in the first place (specifically did you generate them from a UML Design tool)?

For me, development speed is important (along with good supporting documentation). The way I get fast development is to
- Design DB Schema using Case Studio
- Maintain a Excel spreadsheet of seed data
- Generate the DDL
- Generate the Entity Beans
- Generate the seed SQL script (to pre-populate the DB with seed and test data)

PS: I'm a *BIG* fan of maintaining the seed data in an Excel spreadsheet for speeding up development. Having used this, I can't imagine developing a DB schema without such a mechanism (and its dead simple, check out the code in the code generator).

I have this scripted with batch files, so its quick to change the DB design and regenerate everything. This technique does have its downsides...
- Entity Beans ORM mapping does not always map 1-1 from DB Schema (Composite types such as Embedded beans etc)
- Not perfect round tripping (re-generating an existing bean with comments and extra methods etc)

Personally I'd prefer to have an integrated JPA/DB Design tool that supported both the DB and ORM specific issues. That would be the ideal - perhaps one of the JPA vendors already has one underway?


Anyway, I'm still interested to here what you and others have to say on this subject. Perhaps it also greatly depends quite a bit on the individuals perspective on UML vs ER Design (and how much you value the features of DB Design/generation tools such as Case Studio).

Cheers, Rob.

21 May 22:12
by johan

Especially for rapid application prototyping automatic schema generation would be extremely helpful (e.g. look at Grails). Before creating a production release you still can create a new schema or optimize the generated one.

21 Oct 10:46
by Rob

Seems that this is asked for typically from a "Agile" / "Prototyping" perspective. I wonder if "Agile" / "Prototyping" type people use any modeling tools?

That is, if there did exists a UML modeling tool that was capable of generating DDL would that satisfy those types of approaches? I guess it depends on how good the tool is?

24 Nov 18:36
by florin

I second that with a PLUS.

It looks like finally the java world has decided that speed and ease of use IS important for developers not just for ruby and php guys.

I don't do agile per se but I am keen to get started and see results. Many times, small projects don't even require complex ddl yet projects need to get done.

I'd say, yes, have generation to start with. It is convincing enough to get the project sold and even used. Later, of course, you drop generated ddl as *no tool* can catch up. By this time however, the project is rolling and backed by the interested parties.

22 Feb 09:42
by Manuel

I third that! Simple DDL generation for RAD or prototyping works well. Yes larger databases need more control, but for simple MySql based applications its a must have.

22 Feb 20:55
by Rob

Thanks - votes noted... Eddie is also keen so really now its a question of when (rather than if) ...

Create a New Topic

Title:
Body:
 
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse