I usually let JPA create the schema initially only. After, I fine-tune it and maintain it by hand.
I usually let JPA create the schema initially only. After, I fine-tune it and maintain it by hand. There are several reasons I prefer maintaining the schema by hand: it allows putting comments in the SQL code it allows adding comments/descriptions for the tables and columns it allows specifying table spaces and other things that are not possible with JPA annotations it allows splitting the schema creation between several SQL files (one per table + one for the constraints, for example) it lets me reuse some parts of the schema creation script in my schema migration script.
For example, if version 2 of my app introduces 3 new tables, I need an alter script that can reuse the three SQL files creating the three new tables I sometimes need to use synonyms for sequences, rather than concrete ones it lets me choose names for primary key constraints probably some other reasons I've forgotten.
1. I am wondering what are the use cases for using sysnonyms (and specifically for sequences) – Pangea Sep 30 '11 at 8:34 I've had a case where two versions of an application were deployed at the same time, on two different schemas. But we wanted to be able to merge the two schemas afterwards, and thus used synonyms for sequences to make sure both applications used the same sequence, and we would not have duplicate IDs in the two schemas.
– JB Nizet Sep 30 '11 at 8:36 I wouldn't choose comments inside the SQL as an argument. You need to have some more general documantation about your objects/relationships outside your DDL anyways. Table spaces, query indices and such are a valid point, I have not considered this in my question!
Comments and descriptions in the final db schema (e.g. For the db admin) are good as well. I wonder why those are not supported by ORM frameworks?E.g. Extend the existing JPA annotations with comments to allow automatic creation of column descriptions or even db documentation ala javadoc.
– user967058 Sep 30 '11 at 8:38 I was thinking of comments such as "this index is useful for the use-case XYZ.It might be useful to add the foo column in version 3". Or "this constraint is necessary to avoid bug 3452". – JB Nizet Sep 30 '11 at 8:45 After thinking about it a second time, aren't all those points limitations of the ORM frameworks?
After all they're supposed to do the dirty work. If they do not support (automatic) documentation (of their SQL results) or versioning (their own schemata), that's sounds very much like a missing feature to me. Even fine tuning the schema depending on actual usage could be done by the ORM framework.
– user967058 Sep 30 '11 at 8:51.
I usualy do the opposite, i.e. Create the DB schema manually, then I use my IDE to export the JPA entity structure from it. Afterwards, I refine the JPA entities again manualy.
Haven't thought of this yet. Seems like a good idea, since this places the burden of knowing which annotations to use on the IDE :) – user967058 Sep 30 '11 at 8:33.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.