Main | FAQ's | Features | Protocol | Examples | Download | Upgrades

MinneStoreTM Protocol



Query protocol -- Go to the examples page to see how these methods can be used together.

MinneStoreDB instance method Behavior
getAll: objectSetName Start a query. Answers an instance of MSObjectSet
getOne: objectSetName Start a query. Answers an instance of MSObjectSet
getCount: objectSetName Start a query. Answers an instance of MSObjectSet
getValuesOf: indexName for: objectSetName Start a query of index values. Answers an instance of MSObjectSet (version 2.03)
forAll: objectSetName do: aOneArgumentBlock Do something for each object in object set
store: anObject Insert or update an object
store: anObject ifChanged: aZeroArgumentBlock Store an object
storeAll: anObject Insert or update a collection of objects
replace: anObject with: anotherObject This is pretty self-explanatory
transaction: aZeroArgumentBlock Used to group store commands into a transaction (not supported until v2.1)
removeFromCache: anObject Remove a previously retrieved object from the identity cache

MSObjectSet instance method Behavior
where: indexName eq: aValue Limit query to values equal to aValue. aValue may be a collection of values.
where: indexName lt: aValue Limit query to values less than aValue
where: indexName le: aValue Limit query to values less than or equal to aValue
where: indexName gt: aValue Limit query to values greater than aValue
where: indexName ge: aValue Limit query to values greater than or equal to aValue
where: indexName between: aValue1 and: aValue2 Limit query to values between aValue1 and aValue2 inclusive
where: indexName startsWith: aString Limit query to values that start with aString.
(Use only with String domain indexes)
where: indexName hasWord: aString Limit query to values including word aString.
(Use only with MSText domain indexes)
where: indexName hasAllWords: aString Limit query to values including all words in aString.
(Use only with MSText domain indexes)
where: indexName hasSomeWords: aString Limit query to values including at least one of the words in aString.
(Use only with MSText domain indexes)
execute Answers the objects that match the preceding criteria

Note: Any of the "where:" methods can have "and:" or "or:" in place of the "where:" for subsequent statements. (Except in Dolphin version 1 which tries to inline the "and:" and "or:". This should be fixed in the next version. Use "and;where:" and "or;where:" instead.)


Database definition protocol

MinneStoreDB method Behavior
class>>newOn: pathNameString Define a new database on pathNameString. Answers an instance of MinneStoreDB.
class>>openOn: pathNameString Open an existing database on pathNameString. Answers an instance of MinneStoreDB.
addObjectSetNamed: aSymbol Define a new object set. Answers an instance of MSObjectSet.

MSObjectSet instance method Behavior
objectsPerFile: anInteger Defines how many objects to be stored in each data file of this object set. Do not change this number once objects have been stored to it.
storesClass: aClass Defines which class(es) will be stored in this object set.
indexOn: aSymbol domain: aClass aSymbol is the object method selector that answers the value to be indexed.
aspect: aspectName getter: aSymbol1 setter: aSymbol2 hasOne: objectSetName Define a one-to-one aspect of this object set. Aspects are stored in their own object set.
aspect: aspectName hasOne: objectSetName Same as above, but assume the getter method is the same as aspectName. Setter adds a colon to the end.
aspect: aspectName getter: aSymbol1 setter: aSymbol2 hasMany: objectSetName Define a one-to-many aspect of this object set. Aspects are stored in their own object set.
aspect: aspectName hasMany: objectSetName Same as above, but assume the getter method is the same as aspectName. Setter adds a colon to the end.
hasChangedMethod: aSymbol Method named aSymbol should answer true or false whether object has changed since last read or not.
beforeStoringMethod: aSymbol Method named aSymbol will be sent to an object before storing it.
afterStoringMethod: aSymbol Method named aSymbol will be sent to an object after storing it.
afterGettingMethod: aSymbol Method named aSymbol will be sent to an object after reading it.



Main | FAQ's | Features | Protocol | Examples | Download | Upgrades

Send suggestions, questions, etc...
Return to MinneStore main page.