[Glass] Indexes when objects have collection instance variables
Tim Krieg
tim.krieg at fargoAgile.com
Tue Nov 19 07:48:42 PST 2013
Hello,
My name it Tim Krieg, and I'm a first time poster.
I have a question about creating an equalityIndex on an IdentitySet of
objects that also contain another collection in one of its instance
variables.
My application example is this:
A WorkOrder list returns a collection of WorkOrders. A WorkOrder has an
instance variable called startStopTimes (anOrderedCollection) and that
returns a collection of TPTimeStampRange objects that keeps track of the
startingTimeStamp and endingTimeStamp along with its duration.
Because a workOrder can be started and stopped multiple times, it's very
common that the WorkOrder>>startStopTimes collection returns multiple
instances, but I'd like the UI to support fast WorkOrder queries by the
earliest startTimeStamp and the latest stopTimeStamp as well.
I'm not sure of the syntax when creating an equalityIndex on the
startingTimeStamp and endingTimeStamp variables starting with the WorkOrder
objects.
I've seen examples in the manual for the select path that goes something
like this:
select: { :wo | wo.startStopTimes.*.startingTimeStamp >= aTimestamp }.
How would you create an index on this WorkOrder class>>list IdentitySet to
speed up this query?
WorkOrder list
createEqualityIndexOn: 'startStopTimes.*.startingTimeStamp'
withLastElementClass: TimeStamp.
I tried the above (along with a few variations), but obviously it didn't
work. I could also use advice on the select for retrieving the earliest
startTimestamp and latest endingTimeStamp as well. I have it working using
the usual select: method with Smalltalk syntax, but not with Gemstone
indexed path syntax as I need the query to be fast.
Thanks in advance,
Tim
--
View this message in context: http://forum.world.st/Indexes-when-objects-have-collection-instance-variables-tp4723419.html
Sent from the GLASS mailing list archive at Nabble.com.
More information about the Glass
mailing list