Subject | JBuilder / DataExpress Defaults |
---|---|
Author | Eric Everman |
Post date | 2001-04-06T15:25:42Z |
Hi Everyone-
I using JBuilder 4 / DataExpress with Interbase 5.6. My question actually
has more to do with DataExpress- it seems to be ignoring default 'true'
values for
boolean columns. As the values are loaded into a DataExpress DataSet from
Interbase, I coerce Interbase Short Integers to Booleans. If a user adds
new records to the DataSet, defaults and constrains should come from the
metadata for the columns in the DataSet which is persisted with these values:
Type: Boolean
Default: true (also tried True, TRUE, 1, "true", 'true', . . . )
Setting the default to true in this way in the column designer is the
equivalent of:
columnX.setDefault("true");
The column object creates a Variant and assigned it a value based on the the
string "true". To skip the coversion from string to boolean variant, I
tried creating my own True variant in code and assigning it to the column:
Variant vTrue = new Variant();
vTrue.setBoolean(true);
columnX.setDefaultValue(vTrue);
This method DOES work, however, the first method should also work unless i'm
really missing something. Has anyone else run into the problem i've
described?
Thanks,
Eric Everman
I using JBuilder 4 / DataExpress with Interbase 5.6. My question actually
has more to do with DataExpress- it seems to be ignoring default 'true'
values for
boolean columns. As the values are loaded into a DataExpress DataSet from
Interbase, I coerce Interbase Short Integers to Booleans. If a user adds
new records to the DataSet, defaults and constrains should come from the
metadata for the columns in the DataSet which is persisted with these values:
Type: Boolean
Default: true (also tried True, TRUE, 1, "true", 'true', . . . )
Setting the default to true in this way in the column designer is the
equivalent of:
columnX.setDefault("true");
The column object creates a Variant and assigned it a value based on the the
string "true". To skip the coversion from string to boolean variant, I
tried creating my own True variant in code and assigning it to the column:
Variant vTrue = new Variant();
vTrue.setBoolean(true);
columnX.setDefaultValue(vTrue);
This method DOES work, however, the first method should also work unless i'm
really missing something. Has anyone else run into the problem i've
described?
Thanks,
Eric Everman