Sure enough, my WEB-INF/src/java directories had included java files
of zero length, presumably generated during the previous failed
attempts to parse my database schema and then not removed during the
clean commands.
Over that hurdle (thanks to a welcome tip from Jason!) I now have a
few issues with the database XML->Java conversion; the XML->MySQL
appears to be fine (after a cursorary glance) but the Java code ran
into trouble with my default and boolean values -- or perhaps I just
don't understand the intent of some of these attributes.
<column name="CONTROL_PORT"
primaryKey="true"
required="true"
type="INTEGER" default="4076"/>
becomes
CONTROL_PORT INTEGER default 4076 NOT NULL,
which is correct, but this causes a line in the Base*.java to
initialize the NumberKey as
private NumberKey control_port=4076;
(the reason this has primaryKey=true yet has an initializer is because
there are three fields in this table, two strings and this integer
which _together_ form the primary key; is this a correct assumption of
the meaning of primaryKey?)
BTW: primaryKey="true" should _imply_ required="true"; if you
fail to include that second attribute, the SQL generation step
will abort.
My second init error occurs over BOOLEANCHAR fields:
<column name="IS_DELETED" type="BOOLEANCHAR"/>
becomes
IS_DELETED CHAR,
which is fine (and probably more portable) although it leads to
potential tri-state values (Y/N/null) --- MySQL has an optimized
boolean char(0) which can only have the T/F values of ""/null; it
makes less semantic sense than looking at a column of Y/N values, but
it does limit the choices to just two possible values and that
prevents data errors.
At minimum, BOOLEANCHAR should expressly forbid null values and
supply a default, ie, it should produce
IS_DELETED CHAR NOT NULL DEFAULT 'N',
Anyway, this length-less CHAR with Y/N values leads to Java code that
produces the following compile error:
../BaseResourcePeer.java:243: cannot resolve symbol: variable Y
which is true, Y is undefined. The offending java looks like this:
(Y.equals(row.getValue(offset+2).asString()));
which probably meant to say
("Y".equals(row.getValue...
My last issue with initializers occurs with the TIMESTAMP fields.
The MySQL convention is to initialize a TIMESTAMP with the current
clock time when the initializer is NULL, which led me to try
<column name="DATESTAMP" type="TIMESTAMP" default="NULL"/>
but this leads to the type-conflict SQL code
DATESTAMP TIMESTAMP default 'NULL',
So far, my only other error is only a warning on the deprecated call
to javax.servlet.http.HttpSession.getValue(java.lang.String) in
org/apache/turbine/flux/modules/actions/FluxAction.java:99
--
Gary Lawrence Murphy <[EMAIL PROTECTED]> TeleDynamics Communications Inc
Business Innovations Through Open Source Systems: http://www.teledyn.com
"Computers are useless. They can only give you answers."(Pablo Picasso)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]