Dear Paolo,
the DBI.FieldConverter has a funny thing in the conversion lookup
from Smalltalk to Database Type. The look-up is based on classes
and this doesn't really work for Boolean and Integer.
e.g.
st> FieldConverter uniqueInstance print: true on: stdout
will not go through the >>#writeBoolean:on: selector but the
generic one, the same applies to the Integer conversion. This
is because instances are of class True, False, SmallInteger,
LarsePositiveInteger, ....
For the Boolean it was easy to add True/False to the lookup
table for integers this is getting hairy.
I did this:
aValue isNil ifTrue: [ aStream nextPutAll: 'NULL'. ^self ].
aSelector := converterSelectors at: aValue class
ifAbsent: [ aValue isInteger
ifTrue: [#writeInteger:on:]
ifFalse: [#defaultConvert:on:]].
but then again, I could just remove the writeInteger:on:
selector and entry from the look-up table. How should I
proceed?
holger
_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk