在 Smalltalk.Glorp.DatabasePlatform 我添加了两个空方法 #printPreLimitWrapper:on: 和 #printPostLimitWrapper:on: 我在 Smalltalk.Glorp.OraclePlatform 中覆盖:
printPreLimitWrapper: anInteger on: aCommand
aCommand nextPutAll: ' SELECT * FROM ( '
printPostLimitWrapper: anInteger on: aCommand
aCommand nextPutAll: ' ) WHERE ROWNUM <= '.
anInteger printOn: aCommand.
aCommand nextPutAll: ' '.
在 Smalltalk.Glorp.SimpleQuery 我添加了:
printPostLimitWrapperOn: aCommand
self hasLimit ifFalse: [^self].
self platform printPostLimitWrapper: self limit on: aCommand.
printPreLimitWrapperOn: aCommand
self hasLimit ifFalse: [^self].
self platform printPreLimitWrapper: self limit on: aCommand.
在 Smalltalk.Glorp.QuerySelectCommand 我改变了以下方法:
printSQL
query printPreLimitWrapperOn: self.
stream nextPutAll: 'SELECT '.
query printSelectFieldsOn: self.
self findBoundExpressions.
query printTablesOn: self.
query printWhereClauseOn: self.
query printJoinsOn: self.
query printOrderingOn: self.
query printGroupByOn: self.
query printPostLimitOn: self.
query printOffsetOn: self.
query printPostLimitWrapperOn: self.