Bob,
here's a list of my fixes / extensions to the version of glorp that VAST 8.5 ships with. Some of these are already included in current versions of GLORP:
GlorpSession (instance side):
readManyOf: aClass where: aBlock orderBy: aCriteria
| query |
query := SimpleQuery returningManyOf: aClass where: aBlock.
query orderBy: aCriteria.
^self execute: query.
rollbackAndContinue
"A shorter synonym"
^self rollbackUnitOfWorkAndContinue.
rollbackUnitOfWorkAndContinue
"Rollback the current unit of work, but then keep going with the same set of registered objects, with their state updated to reflect current values."
| registeredObjects |
currentUnitOfWork isNil ifTrue: [^self error: 'Not in unit of work'].
registeredObjects := currentUnitOfWork registeredObjects.
currentUnitOfWork newObjects do: [:each | registeredObjects remove: each].
self rollbackUnitOfWork.
self beginUnitOfWork.
self registerAll: registeredObjects.
writeHomogeneousRows: aCollectionOfDatabaseRows
"Write out a collection of rows belonging to a single table"
| representativeRow succeeded maximumSize start |
aCollectionOfDatabaseRows isEmpty ifTrue: [^true].
representativeRow := aCollectionOfDatabaseRows first.
representativeRow shouldBeWritten ifFalse: [^true].
succeeded := true.
maximumSize := self system maximumSizeToGroupWriteFor: aCollectionOfDatabaseRows.
start := 1.
[start > aCollectionOfDatabaseRows size] whileFalse: [
succeeded := succeeded
& (self writeHomogeneousRows: aCollectionOfDatabaseRows from: start to: ((start + maximumSize - 1) min: aCollectionOfDatabaseRows size)).
start := start + maximumSize].
^succeeded.
AccessPlatform:
initializeFunctions
super initializeFunctions.
"Override UPER and LOWER with UCase and LCase"
(functions at: #asUppercase) function: 'UCase'.
(functions at: #asLowercase) function: 'LCase'.
DatabasePlatform:
convertDBBooleanToBoolean: aBoolean for: aType
"It seems GlorpBooleanType saves false as 0 and true as 1"
^(aBoolean ~= 0)
Note: I first made this change to AccessPlatform but found out I need it for DB2Platform as well. I haven't tested if it is necessary for Oracle or any of the not-yet-supported-by-VAST platforms also work with it.
ProtoObject: