tedia2sql Troubleshooting Guide
Murphy's Law
It is very unlikely that your first attempt at creating a Dia UML diagram
that will parse correctly into SQL DDL will be successful. You will
have a couple of Associations that appear to connect Classes, but
in fact don't, or you will have named two Associations the same thing,
or you will have checked the "Abstract" checkbox for a Class that is not
to be a view, but a table.
Whatever the reason, there are a couple of things you can do to figure out
the problem.
Verbosity -- When tedia2sql Dies
Verbosity is your friend. Pass the -v 1 option to tedia2sql when
running your script. It will tell you which Class, Association, SmallPackage,
or other Dia object it's attempting to parse.
Using this output, you'll know which object tedia2sql bombed out on, and you
can fix it.
For example, if you forget to attach both ends of an Association to Classes,
tedia2sql complains (somewhat cryptically):
Can't call method "getAttribute" on an undefined value....
Running the script with -v 1 shows the following:
generateAssociationSQL(): Parsing UML Association id=O17
Got NAME=fk_iaac
Can't call method "getAttribute" on an undefined value....
Aha! We now know that generateAssociationSQL() died, and the name of
the Association was fk_iaac. Thus, find your fk_iaac and see if something is
wrong with it (like, say, one end isn't attached to a Class).
SQL Errors -- When the SQL DDL Won't Compile
This is an area that's a little more grey. Find the error and determine
if it's because you made a typo or if tedia2sql has generated some
faulty SQL. Running tedia2sql with the -v 2 option might generate
a little insight into the problem as well.
If it is truly a misfeature with tedia2sql, where it generates invalid
SQL DDL, please contact me via the project homepage (at
Tigris dot Org) so that I can
look into it. Alternatively, fix the problem and send a patch.
A couple of possibilities as to why tedia2sql created invalid SQL that
are really your fault :-)...
- You made the Class "Abstract" indicating this should be
a view, but otherwise you tried to create a table. This causes
tedia2sql to create a view with column datatypes and primary
key clauses, etc. (Bad) Also, the converse.
- You tried to make a column "NOT NULL" but used mixed-case
(ie: "not NULL" or "Not Null") in the value field.
- You forgot an "and" or "or" in your view where clause.
- You named the end of an Association an Attribute name that
doesn't exist in the Class.
- You named two Associations or indexes the same thing.
- You misspelled or malformed a datatype, eg: "varchar (24"
or "timespamp". In the first instance, you forgot your right paren, in the
second, the first "p" should be a "t".