incubator-empire-db-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From McKinley <mckinley1...@gmail.com>
Subject Re: DataType.AUTOINC Probably Needs a Change
Date Tue, 19 Jan 2010 23:15:33 GMT
A few more thoughts.

On Tue, Jan 19, 2010 at 9:27 PM, Rainer Döbele <doebele@esteam.de> wrote:
> by interpreting the word integer here as "non fractional number" and explicitly not as
in the Java type int.

This would continue to be the case as no new types would be added to
DataType and those already are not explicit Java types. Nothing would
change in this regard.

> But theoretically we could make autoinc an option of the integer type.
> But on the other hand I don't like the idea of creating a autoinc property since it would
not make sense for any other data type (at least not as far as I know).

I recommend making autoinc and option of DBTableColumn and not of any
DataType. It is meta data of the column and not of the type, after
all. So, nothing changes with anything in DataType.

> At the moment, I do neither see the requirement nor a benefit in changing this.

Adding one boolean and its setter and getter and changing only 6 or
fewer instances of lines like col.getDataType()==DataType.AUTOINC to
col.isAutoIncrement() fixes every DataType bug or missing feature
related to AUTOINC for free. It is 12 lines of code divided by 5
files.

boolean isAutoIncrement() { return autoinc || type ==
DataType.AUTOINC; } \\ Everyone wins!

The meta data on the patch will be bigger than the patch for the DML
part of this change. The DDL fixes are more about adding more
information to support currently unsupported declarations than fixing
bugs.

Thanks,

McKinley

Mime
View raw message