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.