Ok, rephrased second question after some thought.
Consider the following:
<database name="stocktrack" defaultIdMethod="native">
<table name="STOCK">
<column name="STOCK_ID" primaryKey="true" required="true" type="INTEGER"/>
<column name="STOCK_SYMBOL" required="true" type="VARCHAR" size="10"/>
<column name="STOCK_LONG_NAME" required="true" type="VARCHAR" size="30"/>
<column name="STOCK_TYPE_ID" required="true" type="CHAR" size="1"/>
</table>
</database>
If I instantiate this under MySQL, I get the following SQL:
CREATE TABLE STOCK
(
STOCK_ID INTEGER NOT NULL,
STOCK_SYMBOL VARCHAR (10) NOT NULL,
STOCK_LONG_NAME VARCHAR (30) NOT NULL,
STOCK_TYPE_ID CHAR (1) NOT NULL,
PRIMARY KEY(STOCK_ID),
);
Here's the question: By using defaultIdMethod=native, I'd think that I'm
implying that integer primary key tables should autoincrement, since if I
used defaultIdMethod=idBroker, that's the behavior I'd see. This (to me)
means that this should generate this instead:
CREATE TABLE STOCK
(
STOCK_ID INTEGER AUTO_INCREMENT NOT NULL,
STOCK_SYMBOL VARCHAR (10) NOT NULL,
STOCK_LONG_NAME VARCHAR (30) NOT NULL,
STOCK_TYPE_ID CHAR (1) NOT NULL,
PRIMARY KEY(STOCK_ID),
);
Can anyone think of a case where this would not be the right thing to
do? Or should I just by manually specifying autoincrement in the XML?
James
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>