Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.9.3
-
Fix Version/s: 1.1 M2
-
Component/s: JDO DDL generator
-
Labels:None
-
Environment:Operating System: All
Platform: All
-
Bugzilla Id:959
-
Number of attachments :
Description
I didn't find this in Castor yet, and I think that is handy to create the script
from the mapping files. It would either be used as a starting point to finetune
by hand, or as something that can be generated when needed, so one doesn't have
to to change both the mapping and the database by hand when the datamodel changes.
I made a first shot at it, using XSL stylesheets. It is very limited;
- it has only been tested with two mappings on postgresql
- it only knows quoting rules and some jdbc type -> database type rules for
postgresql - it only works with non-complex identities (otherwise primary key declarations
will be omitted) - it can only find the sql type of a foreign key column if the java class that
it maps to is defined in the same mapping file, otherwise the type "integer"
is assumed - it probably contains many bugs
Still I wanted to share it already, in case I don't continue working on it or
else to see if this is something that people find interesting.
Issue Links
- is depended upon by
-
CASTOR-1535
Generate sql scripts for CTF tests by ddlgen from mapping
-
- is related to
-
CASTOR-1494
Inconsistencies between sql types in mapping and ddl scripts of CTF
-
Created an attachment (id=114)
XSL stylesheet that generates "create table" commands