[Glass] Time Index question

BrunoBB via Glass glass at lists.gemtalksystems.com
Fri Feb 19 08:58:36 PST 2016


Hi All,

I having problems when creating a equality index on a Time instance
variable.

The following works ok with a index on String:
| stringField stringCol |
 
IndexManager current removeAllIndexes.

stringField := AppFieldStringValue new.
stringField name: 'name';
	originalValue: 'hello';
	setValue: 'hello'.

stringCol := RcIdentityBag new.
stringCol add: stringField.

stringCol createEqualityIndexOn: 'value' 
withLastElementClass: String.

(GsQuery fromString: 
('each.value  = ', '''hello''') on: stringCol) 
queryResult.

"BUT IF I WANT TO DO THE SAME WITH TIME I GET AN ERROR"
"ERROR:
a Time class does not understand 
#'_idxBasicCanCompareWithCharacterCollectionInstance:"
| timeField timeCol |

IndexManager current removeAllIndexes.

timeField := AppFieldTimeValue new.
timeField name: 'time';
	originalValue: Time now;
	setValue: Time now.

timeCol := RcIdentityBag new.
timeCol add: timeField.

timeCol createEqualityIndexOn: 'value' 
withLastElementClass: Time.

(GsQuery fromString: 
('each.value  = ', '''15:00:00''') on: timeCol) 
queryResult.

The index is on "value" instance variable of AppFieldTimeValue class.
What are the basic classes to create indexes ? String, Integer, Time, Date,
TimeStamp... or what ?

There are SmallInteger indexes in the GS manual at Example 7.12 (page 126)

Any help is appreciated ?

Regards,
Bruno



--
View this message in context: http://forum.world.st/Time-Index-question-tp4879024.html
Sent from the GLASS mailing list archive at Nabble.com.


More information about the Glass mailing list