From VisualWorks®, 7.4 of December 5, 2005 on December 5, 2005 at 2:06:32 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>Oracle7Transporter</name> <environment>Smalltalk</environment> <super>Lens.LensSQLTransporter</super> <private>false</private> none <imports></imports> <category>Lens-Private-Oracle</category> <attributes> <package>OracleLens</package> </attributes> </class> <comment> Oracle7Transporter
This class is private to the implementation of the ObjectLens. Users should not use this class directly and should not subclass it.
</comment> <class> <name>Oracle7ConstraintColumn</name> <environment>Smalltalk</environment> <super>Core.Object</super> <private>false</private> none constraint tableName columnName position <imports></imports> <category>Lens-Private-Oracle</category> <attributes> <package>OracleLens</package> </attributes> </class> <comment> Oracle7ConstraintColumn
This class is private to the implementation of the ObjectLens. Users should not use this class directly and should not subclass it. Instance variables: constraint <String> tableName <String> columnName <String> position <SmallInteger>
</comment> <class> <name>Oracle7TableColumn</name> <environment>Smalltalk</environment> <super>Lens.LensDatabaseTableColumn</super> <private>false</private> none name table dataType width precision scale isNotNil nullable <imports></imports> <category>Lens-Private-Oracle</category> <attributes> <package>OracleLens</package> </attributes> </class> <comment> Oracle7TableColumn
This class is private to the implementation of the ObjectLens. Users should not use this class directly and should not subclass it. Instance Variables: name <String> the column's name table <LensDatabaseTable> the table containing the column dataType <String> the data type of the column (in a database-specific encoding) width <nil | SmallInteger> the column's width constraint precision <nil | SmallInteger> the column's precision, if numeric scale <nil | SmallInteger> the column's scale, if numeric isNotNil <Boolean> true when the column may not contain nil nullable <String>
</comment> <class> <name>Oracle7IndexColumns</name> <environment>Smalltalk</environment> <super>Core.Object</super> <private>false</private> none indexOwner indexName table columnName columnPosition <imports></imports> <category>Lens-Private-Oracle</category> <attributes> <package>OracleLens</package> </attributes> </class> <comment> Oracle7IndexColumns
This class is private to the implementation of the ObjectLens. Users should not use this class directly and should not subclass it. Instance variables: indexOwner <String> indexName <String> table <Oracle7Table> columnName <String> columnPosition <SmallInteger>
</comment> <class> <name>Oracle7Table</name> <environment>Smalltalk</environment> <super>Lens.LensDatabaseTable</super> <private>false</private> none name tableType columns owner primaryKey indexes <imports></imports> <category>Lens-Private-Oracle</category> <attributes> <package>OracleLens</package> </attributes> </class> <comment> Oracle7Table
This class is private to the implementation of the ObjectLens. Users should not use this class directly and should not subclass it. Instance Variables: name <String> the table's name tableType <String> encodes the type of table (database-specific) columns <(IdentitySet of: LensDatabaseTableColumn) | nil> the set of columns defined on the table owner <String> the table's owner primaryKey <Object> indexes <Collection of: Oracle7Index>
</comment> <class> <name>Oracle7Context</name> <environment>Smalltalk</environment> <super>Lens.LensDatabaseContext</super> <private>false</private> none <imports></imports> <category>Lens-Private-Oracle</category> <attributes> <package>OracleLens</package> </attributes> </class> <comment> Oracle7Context
This class is private to the implementation of the ObjectLens. Users should not use this class directly and should not subclass it.
</comment> <class> <name>Oracle7Constraint</name> <environment>Smalltalk</environment> <super>Core.Object</super> <private>false</private> none owner constraintName constraintType table referencedConstraint <imports></imports> <category>Lens-Private-Oracle</category> <attributes> <package>OracleLens</package> </attributes> </class> <comment> Oracle7Constraint
This class is private to the implementation of the ObjectLens. Users should not use this class directly and should not subclass it. Instance variables: owner <String> constraintName <String> constraintType <String> table <Oracle7Table> referencedConstraint <Oracle7Constraint>
</comment> <class> <name>Oracle7Index</name> <environment>Smalltalk</environment> <super>Lens.LensDatabaseIndex</super> <private>false</private> none owner table uniqueness <imports></imports> <category>Lens-Private-Oracle</category> <attributes> <package>OracleLens</package> </attributes> </class> <comment> Oracle7Index
This class is private to the implementation of the ObjectLens. Users should not use this class directly and should not subclass it. Inherited instance variables: name <String> indexVariables <Object> Instance variables: owner <String> table <Oracle7Table> uniqueness <String>
</comment> <methods> Oracle7Transporter <category>data manipulation</category>
giveNextSerialNumberTo: variable of: object "Put the next generated serial number into variable of object. Answer the value used." ^object instVarAt: variable instVarIndex put: (session connection getSession nextSequenceNumberFor: (variable objectType dataModel databaseContext sequenceNameFor: variable))
</methods> <methods> Oracle7Transporter <category>querying</category>
queryFor: operation | query | query := super queryFor: operation. "generate locking clause" (session checkLocking: operation isLocking) ifTrue: [ query body: query body , ' FOR UPDATE NOWAIT']. ^query
</methods> <methods> Oracle7Transporter <category>registration</category>
nextVariableName "Answer a name to be used for the next variable being created." ^ ':' , (variableIndex := variableIndex + 1) printString
</methods> <methods> Oracle7Transporter class <category>class initialization</category>
initialize "Oracle7Transporter initialize" self initializeFunctionsTable
initializeFunctionsTable "Oracle7Transporter initializeFunctionsTable" | dict | super initializeFunctionsTable. dict := functions at: #Number. dict at: #abs put: 'ABS'. dict at: #ceil put: 'CEIL'. dict at: #floor put: 'FLOOR'. dict at: #mod: put: 'MOD'. dict at: #power: put: 'POWER'. dict at: #round: put: 'ROUND'. dict at: #sign put: 'SIGN'. dict at: #sqrt put: 'SQRT'. dict at: #trunc: put: 'TRUNC'. dict at: #cos put: 'COS'. dict at: #cosh put: 'COSH'. dict at: #exp put: 'EXP'. dict at: #ln put: 'LN'. dict at: #log: put: 'LOG'. dict at: #sin put: 'SIN'. dict at: #sinh put: 'SINH'. dict at: #tan put: 'TAN'. dict at: #tanh put: 'TANH'. dict := functions at: #Character. dict at: #ascii put: 'ASCII'. dict at: #concat: put: 'CONCAT'. dict at: #length put: 'LENGTH'. dict at: #lower put: 'LOWER'. dict at: #soundex put: 'SOUNDEX'. dict at: #substringAt:length: put: 'SUBSTR'. dict at: #upper put: 'UPPER'. dict := functions at: #Date. dict at: #toDate put: 'TO_DATE'. dict at: #toDate: put: 'TO_DATE'. dict := functions at: #Conversion. dict at: #toChar put: 'TO_CHAR'. dict at: #toChar: put: 'TO_CHAR'.
</methods> <methods> Oracle7ConstraintColumn <category>accessing</category>
columnName "Answer the receiver's columnName." ^columnName
constraint "Answer the receiver's constraint." ^constraint
position "Answer the receiver's position." ^position
tableName "Answer the receiver's tableName." ^tableName
</methods> <methods> Oracle7TableColumn <category>accessing</category>
dataType "Answer the receiver's dataType." ^dataType
dataType: newDataType "Set the receiver's dataType to newDataType." dataType := newDataType
isNotNil "Answer whether the column described by the receiver cannot store nulls." ^isNotNil
isNotNil: newIsNotNil "Set the receiver's isNotNil to newIsNotNil." isNotNil := newIsNotNil
maxColumnConstraint "Answer the receiver's width." ^width
maxColumnConstraint: newWidth "Set the receiver's width to newWidth." width := newWidth
name "Answer the receiver's name." ^name
name: newName "Set the receiver's name to newName." name := newName
precision "Answer the receiver's precision." ^precision
precision: newPrecision "Set the receiver's precision to newPrecision." precision := newPrecision
scale "Answer the receiver's scale." ^scale
scale: newScale "Set the receiver's scale to newScale" scale := newScale
table "Answer the receiver's table." ^table
table: newTable "Set the receiver's table to newTable." self update: 'table' to: newTable
</methods> <methods> Oracle7TableColumn <category>private</category>
fromLiteralArrayEncoding: anArray super fromLiteralArrayEncoding: anArray. width := width decodeAsLiteralArray
</methods> <methods> Oracle7TableColumn <category>initialize-release</category>
postFetchInitialize: ignored "Decode isNotNil from nullable." self dataType: self dataType asLowercase. ('long*' match: self dataType) ifTrue: [ self maxColumnConstraint: self defaultBLOBSize ]. self isNotNil: nullable = 'N'. self precision notNil ifTrue: [ self maxColumnConstraint: self precision ].
</methods> <methods> Oracle7TableColumn class <category>accessing</category>
contextClass "Answer the name of the class which provides database context." ^Oracle7Context
</methods> <methods> Oracle7TableColumn class <category>private</category>
encodedAspects ^#(#name #dataType #maxColumnConstraint #precision #scale #(#pickledIsNotNil #isNotNil:) )
</methods> <methods> Oracle7IndexColumns <category>accessing</category>
columnName "Answer the receiver's columnName." ^columnName
columnPosition "Answer the receiver's columnPosition." ^columnPosition
indexName "Answer the receiver's indexName." ^indexName
indexOwner "Answer the receiver's indexOwner." ^indexOwner
table "Answer the receiver's table." ^table
</methods> <methods> Oracle7Table <category>printing</category>
displayString ^self qualifiedName
name "Answer the receiver's name." ^name
</methods> <methods> Oracle7Table <category>key detection</category>
getPrimaryKeyIn: aLensSession "Answer the primary key for this table by looking it up in the database catalogs. Answer an instance of LensTableKey or nil." | constraints pkey | constraints := aLensSession containerOf: Oracle7Constraint. pkey := constraints select: [ :cons | (cons table = self) & (cons constraintType = 'P') ]. pkey isEmpty ifFalse: [ "We found a valid primary key, make a LensTableKey to hold it." | colCont qry consCols tabCols | colCont := aLensSession containerOf: Oracle7ConstraintColumn. qry := colCont selectWhere: [ :cols | cols constraint = pkey first ]. qry orderBy: [ :cols | cols position ]. consCols := qry values. tabCols := consCols collect: [ :cons | self columns detect: [ :each | each name = cons columnName ] ] . ^LensTableKey table: self columns: tabCols keyType: #primary ]. ^nil
inferReferencesIn: aLensSession "We use tables also as non-persistent objects, therefore, aLensSession is passed to this method and the table's own lens is not used (if it even had one). This method returns a collection with arrays representing references from the table to other tables" | constraintColumns cons res | constraintColumns := aLensSession containerOf: Oracle7ConstraintColumn. owner isNil ifTrue: [cons := constraintColumns select: [:col | col constraint table name = self name & (col constraint constraintType = 'R')]] ifFalse: [cons := constraintColumns select: [:col | col constraint table owner = owner & (col constraint table name = self name) & (col constraint constraintType = 'R')]]. res := OrderedCollection new. [cons size > 0] whileTrue: [| others con | con := cons first. others := SortedCollection sortBlock: [:c1 :c2 | c1 position <= c2 position]. cons do: [:c | c constraint = con constraint ifTrue: [others add: c]]. res add: (Array with: self with: (others collect: [ :c | c columnName ]) with: con constraint referencedConstraint table tableNameArray). cons removeAll: others]. ^res
</methods> <methods> Oracle7Table <category>accessing</category>
columns: newColumns "Set the receiver's columns to newColumns." columns := newColumns
indexes "Answer the receiver's indexes." indexes == nil ifTrue: [ indexes := IdentitySet new ]. ^indexes
name: newName "Set the receiver's name to newName." name := newName
owner ^owner
owner: newOwner "Set the receiver's owner to newOwner." owner := newOwner
tableNameArray "Construct a 1 or element array with the tableName and owner." | elems | elems := OrderedCollection new: 2. elems add: self name. (self owner notNil and: [self owner isEmpty not]) ifTrue: [ elems add: self owner ]. ^elems
tableType "Answer the receiver's tableType." ^tableType
</methods> <methods> Oracle7Table <category>comparing</category>
<= anOracle7Table "Answer whether anOracle7Table collates after the receiver." | so oo | ^(so := self owner) < (oo := anOracle7Table owner) or: [ so = oo and: [ self name <= anOracle7Table name ] ]
= anOracle7Table "Answer whether anOracle7Table has the same owner and name as the receiver." ^self species == anOracle7Table species and: [ self owner = anOracle7Table owner and: [ self name = anOracle7Table name ] ]
hash "Modify the hash method to be based on the owner and name combined." ^(self owner hash bitShift: 3) bitXor: self name hash
</methods> <methods> Oracle7Table <category>qualifications</category>
qualify: ldm owner := ldm databaseContext username asUppercase
unqualify owner := nil
</methods> <methods> Oracle7Table <category>private-accessing</category>
privateColumns "Answer the contents of the instance variable which holds the receiver's columns." ^columns
</methods> <methods> Oracle7Table <category>testing</category>
isReferredToBy: tableNameArray "Answer whether tableNameArray contains a viable reference to this table. The tableNameArray is composed of name elements ordered from the RIGHT to left in a qualification order (i.e. the simple name comes first and then any qualification)." | temp1 temp2 | ^(super isReferredToBy: tableNameArray) and: [ tableNameArray size < 2 or: [ (temp1 := self owner) isNil or: [ temp1 isEmpty or: [ (temp2 := tableNameArray at: 2) isNil or: [ temp1 = temp2 ] ] ] ] ]
</methods> <methods> Oracle7Table class <category>accessing</category>
contextClass "Answer the name of the class which provides database context." ^Oracle7Context
</methods> <methods> Oracle7Table class <category>private</category>
encodedAspects ^#(#owner)
</methods> <methods> Oracle7Context <category>data dictionary manipulation</category>
createSequenceFor: variable in: session "Add sequence to the data dictionary if not already present." | seqName | seqName := self sequenceNameFor: variable. self class connectionClass unableToExecuteSQLSignal handle: [:ex | | p | p := ex parameter. (p isNil or: [ p isEmpty or: [ (p at: 1) dbmsErrorCode abs ~= 955 ]]) ifTrue: [ ex reject "Some other problem." ] ifFalse: [ ex return "OK, do nothing." ] ] do: [ session connection doCommandString: 'create sequence ' , seqName ]
dropSequenceFor: variable in: session "Remove sequence in session. It's perfectly OK for it to be gone already since that's what we're trying to achieve." | seqName | seqName := self sequenceNameFor: variable. self class connectionClass unableToExecuteSQLSignal handle: [:ex | | p | p := ex parameter. (p isNil or: [ p isEmpty or: [ (p at: 1) dbmsErrorCode abs ~= 2289 ]]) ifTrue: [ ex reject "Some other problem." ] ifFalse: [ ex return "OK, do nothing." ] ] do: [ session connection doCommandString: 'drop sequence ' , seqName ]
getTableNamed: tableName in: aLens "Answer the table named tableName from the data dictionary. tableName may contain an owner to qualify the table name." | query where criteria table | query := (aLens containerOf: self class tableClass). "If the owner was specified, then we need to ask using both owner and table name." where := ComposedBlock new add: [:t | t tableType in: #( 'TABLE' 'VIEW' ) ]. criteria := self separateNameQualification: tableName asUppercase. criteria size > 1 ifTrue: "Name includes owner qualifier" [ where add: [ :t | t owner = (criteria at: 2) ] ]. where add: [ :t | t name = (criteria at: 1) ]. "Run the query" table := query detect: where ifNone: [nil]. ^table
listTablesLike: aPattern in: aLens "Answer a collection of tables which are accessible using aLens. If aPattern is not nil, limit the search to only those tables with names matching." | query where tables | query := (aLens containerOf: self class tableClass) orderBy: [:t | t owner, t name]. where := ComposedBlock new add: [:t | t tableType in: #( 'TABLE' 'VIEW' ) ]. aPattern == nil ifFalse: [ | criteria | criteria := self separateNameQualification: aPattern asUppercase. criteria size > 1 ifTrue: "Pattern includes owner qualifier" [ where add: [ :t | t owner isLike: (criteria at: 2) ] ]. criteria size > 0 ifTrue: "Pattern includes tableName qualifier" [ where add: [ :t | t name isLike: (criteria at: 1) ] ] ]. query selectWhere: where. tables := query values. ^tables
sequenceNameFor: variable "Answer an array describing the name of the sequence generator for variable." | table seqName | table := variable objectType table. seqName := table name asUppercase, '$SEQ'. [seqName size > self class maxNameSize] whileTrue: [seqName := seqName dropVowels: 1]. ^table owner notNil ifTrue: [ table owner , '.' , seqName ] ifFalse: [ seqName ]
synchronizeDataDictionaryForType: type in: session "Synchronize the data dictionary for type, by adding new or modifying existing database resources." "Make sure there is a sequence if it is needed." type serialNumberVariable notNil ifTrue: [ self createSequenceFor: type serialNumberVariable in: session]. super synchronizeDataDictionaryForType: type in: session
</methods> <methods> Oracle7Context <category>private</category>
isColumnType: dataModelColType compatibleWith: databaseColType "Answer whether the data model and database column types are compatible." ^(super isColumnType: dataModelColType compatibleWith: databaseColType) or: [ (dataModelColType sameAs: 'varchar2') and: [databaseColType sameAs: 'char']]
</methods> <methods> Oracle7Context <category>printing</category>
displayString | strm | strm := (String new: 128) writeStream. strm nextPutAll: self class kind; nextPutAll: ': '. username isEmpty ifFalse: [ strm nextPutAll: username ]. environment isEmpty ifFalse: [ strm nextPut: Character space; nextPutAll: environment ]. ^strm contents
printOn: stream "Append to stream a sequence of characters that identifies the receiver." | elaborated | elaborated := false. super printOn: stream. (username isNil or: [username isEmpty]) ifFalse: [elaborated := true. stream nextPut: $(; nextPutAll: 'user='; nextPutAll: username; nextPut: Character space]. (environment isNil or: [environment isEmpty]) ifFalse: [elaborated ifFalse: [stream nextPut: $(]. stream nextPutAll: 'env='; nextPutAll: environment; nextPut: Character space]. elaborated ifTrue: [stream skip: -1. stream nextPutAll: ')']
</methods> <methods> Oracle7Context <category>testing</category>
isOracle7 "Answer whether receiver is an Oracle7 context." ^true
</methods> <methods> Oracle7Context class <category>accessing</category>
connectionClass "Answer the class of connections opened by instances of self." ^(self environment at: #OracleConnection ifAbsent: [nil])
kind "Answer user-friendly label for receiver." ^#Oracle7
tableClass "Answer the class of tables for the receiver." ^Oracle7Table
tableColumnClass "Answer the class of table columns in receiver's data dictionary." ^Oracle7TableColumn
transporterClass "Answer the class of transporters via which to dynamically access the receiver's associated database." ^Oracle7Transporter
</methods> <methods> Oracle7Context class <category>private</category>
encodedAspects ^#()
markedAsSystemClass "This class not to be shown when browsing user classes."
</methods> <methods> Oracle7Context class <category>database specs</category>
catalogDataModelSpec "Answer a literal array encoding of the data model used to access the system catalog." "LensEditor new openOnClass: self andSelector: #catalogDataModelSpec" ^#(#LensDataModel #setDatabaseContext: #(#Oracle7Context #username: '' #environment: '' ) #structureTypes: #( #(#LensStructureType #memberClass: #Oracle7Table #setVariables: #( #(#LensStructureVariable #name: 'name' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'table_name' #dataType: 'varchar2' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: false #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'tableType' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'table_type' #dataType: 'varchar2' #maxColumnConstraint: 11 ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'columns' #setValueType: #Object #fieldType: #Object #generatesAccessor: false #generatesMutator: false #privateIsMapped: false ) #(#LensStructureVariable #name: 'owner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'owner' #dataType: 'varchar2' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: false #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'primaryKey' #setValueType: #Object #fieldType: #Object #generatesAccessor: false #generatesMutator: false #privateIsMapped: false ) #(#LensStructureVariable #name: 'indexes' #setValueType: #(#LensCollectionType #memberClass: #IdentitySet #setVariables: #() #defersPostingUpdates: true #indexes: #() #elementType: #Oracle7Index ) #fieldType: #Object #inverse: 'table' #generatesAccessor: true #generatesMutator: false #privateIsMapped: false ) ) #table: #(#Oracle7Table #name: 'ALL_CATALOG' #owner: 'SYS' ) #defersPostingUpdates: true #idVariable: #('name' 'owner' ) #idGeneratorType: #userDefinedId #indexes: #() ) #(#LensStructureType #memberClass: #Oracle7TableColumn #setVariables: #( #(#LensStructureVariable #name: 'name' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'column_name' #dataType: 'varchar2' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: false #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'table' #setValueType: #Oracle7Table #fieldType: #(#LensStructureType #memberClass: #Array #setVariables: #( #(#LensStructureVariable #name: 'name' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'table_name' #dataType: 'varchar2' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'owner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'owner' #dataType: 'varchar2' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true #isNotNil: true ) ) #table: #(#Oracle7Table #name: 'ALL_TAB_COLUMNS' #owner: 'SYS' ) #defersPostingUpdates: true #indexes: #() ) #generatesAccessor: false #generatesMutator: false #isId: true #privateIsMapped: true ) #(#LensStructureVariable #name: 'dataType' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'data_type' #dataType: 'char' #maxColumnConstraint: 9 ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'width' #setValueType: #Integer #fieldType: #Integer #column: #(#Oracle7TableColumn #name: 'data_length' #dataType: 'number' ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'precision' #setValueType: #Integer #fieldType: #Integer #column: #(#Oracle7TableColumn #name: 'data_precision' #dataType: 'number' ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'scale' #setValueType: #Integer #fieldType: #Integer #column: #(#Oracle7TableColumn #name: 'data_scale' #dataType: 'number' ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'isNotNil' #setValueType: #Object #fieldType: #Object #generatesAccessor: false #generatesMutator: false #privateIsMapped: false ) #(#LensStructureVariable #name: 'nullable' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'nullable' #dataType: 'char' #maxColumnConstraint: 1 ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) ) #table: #(#Oracle7Table #name: 'ALL_TAB_COLUMNS' #owner: 'SYS' ) #defersPostingUpdates: true #idVariable: #('name' 'table' ) #idGeneratorType: #userDefinedId #indexes: #() ) #(#LensStructureType #memberClass: #Oracle7Constraint #setVariables: #( #(#LensStructureVariable #name: 'owner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'owner' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'constraintName' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'constraint_name' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'constraintType' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'constraint_type' #dataType: 'char' #maxColumnConstraint: 2 ) #generatesAccessor: true #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'table' #setValueType: #Oracle7Table #fieldType: #(#LensStructureType #memberClass: #Array #setVariables: #( #(#LensStructureVariable #name: 'name' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'table_name' #dataType: 'varchar2' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'owner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'owner' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true #isNotNil: true ) ) #table: #(#Oracle7Table #name: 'ALL_CONSTRAINTS' #owner: 'SYS' ) #defersPostingUpdates: true #indexes: #() ) #generatesAccessor: true #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'referencedConstraint' #setValueType: #Oracle7Constraint #fieldType: #(#LensStructureType #memberClass: #Array #setVariables: #( #(#LensStructureVariable #name: 'owner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'r_owner' #dataType: 'varchar2' #maxColumnConstraint: 30 ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'constraintName' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'r_constraint_name' #dataType: 'varchar2' #maxColumnConstraint: 30 ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) ) #table: #(#Oracle7Table #name: 'ALL_CONSTRAINTS' #owner: 'SYS' ) #defersPostingUpdates: true #indexes: #() ) #generatesAccessor: true #generatesMutator: false #privateIsMapped: true ) ) #table: #(#Oracle7Table #name: 'ALL_CONSTRAINTS' #owner: 'SYS' ) #defersPostingUpdates: true #idVariable: #('owner' 'constraintName' ) #idGeneratorType: #userDefinedId #indexes: #() ) #(#LensStructureType #memberClass: #Oracle7ConstraintColumn #setVariables: #( #(#LensStructureVariable #name: 'constraint' #setValueType: #Oracle7Constraint #fieldType: #(#LensStructureType #memberClass: #Array #setVariables: #( #(#LensStructureVariable #name: 'owner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'owner' #dataType: 'varchar2' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: false #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'constraintName' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'constraint_name' #dataType: 'varchar2' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: false #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) ) #table: #(#Oracle7Table #name: 'ALL_CONS_COLUMNS' #owner: 'SYS' ) #defersPostingUpdates: true #indexes: #() ) #generatesAccessor: true #generatesMutator: false #isId: true #privateIsMapped: true ) #(#LensStructureVariable #name: 'tableName' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'table_name' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'columnName' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'column_name' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'position' #setValueType: #Integer #fieldType: #Integer #column: #(#Oracle7TableColumn #name: 'position' #dataType: 'number' ) #generatesAccessor: true #generatesMutator: false #privateIsMapped: true ) ) #table: #(#Oracle7Table #name: 'ALL_CONS_COLUMNS' #owner: 'SYS' ) #defersPostingUpdates: true #idVariable: #('constraint' 'columnName' ) #idGeneratorType: #userDefinedId #indexes: #() ) #(#LensStructureType #memberClass: #Oracle7Index #setVariables: #( #(#LensStructureVariable #name: 'name' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'index_name' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'indexedVariables' #setValueType: #Object #fieldType: #Object #generatesAccessor: false #generatesMutator: false #privateIsMapped: false ) #(#LensStructureVariable #name: 'owner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'owner' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'table' #setValueType: #Oracle7Table #fieldType: #(#LensStructureType #memberClass: #Array #setVariables: #( #(#LensStructureVariable #name: 'name' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'table_name' #dataType: 'varchar2' #maxColumnConstraint: 30 ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'owner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'table_owner' #dataType: 'varchar2' #maxColumnConstraint: 30 ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) ) #table: #(#Oracle7Table #name: 'ALL_INDEXES' #owner: 'SYS' ) #defersPostingUpdates: true #indexes: #() ) #inverse: 'indexes' #generatesAccessor: true #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'uniqueness' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'uniqueness' #dataType: 'char' #maxColumnConstraint: 9 ) #generatesAccessor: true #generatesMutator: false #privateIsMapped: true ) ) #table: #(#Oracle7Table #name: 'ALL_INDEXES' #owner: 'SYS' ) #defersPostingUpdates: true #idVariable: #('name' 'owner' ) #idGeneratorType: #userDefinedId #indexes: #() ) #(#LensStructureType #memberClass: #Oracle7IndexColumns #setVariables: #( #(#LensStructureVariable #name: 'indexOwner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'index_owner' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'indexName' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'index_name' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'table' #setValueType: #Oracle7Table #fieldType: #(#LensStructureType #memberClass: #Array #setVariables: #( #(#LensStructureVariable #name: 'name' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'table_name' #dataType: 'varchar2' #maxColumnConstraint: 30 ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'owner' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'table_owner' #dataType: 'varchar2' #maxColumnConstraint: 30 ) #generatesAccessor: false #generatesMutator: false #privateIsMapped: true ) ) #table: #(#Oracle7Table #name: 'ALL_IND_COLUMNS' #owner: 'SYS' ) #defersPostingUpdates: true #indexes: #() ) #generatesAccessor: true #generatesMutator: false #privateIsMapped: true ) #(#LensStructureVariable #name: 'columnName' #setValueType: #String #fieldType: #String #column: #(#Oracle7TableColumn #name: 'column_name' #dataType: 'char' #maxColumnConstraint: 30 #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #isId: true #privateIsMapped: true #isNotNil: true ) #(#LensStructureVariable #name: 'columnPosition' #setValueType: #Integer #fieldType: #Integer #column: #(#Oracle7TableColumn #name: 'column_position' #dataType: 'number' #isNotNil: true ) #generatesAccessor: true #generatesMutator: false #privateIsMapped: true #isNotNil: true ) ) #table: #(#Oracle7Table #name: 'ALL_IND_COLUMNS' #owner: 'SYS' ) #defersPostingUpdates: true #idVariable: #('indexOwner' 'indexName' 'columnName' ) #idGeneratorType: #userDefinedId #indexes: #() ) ) #lensPolicyName: #Mixed #lensTransactionPolicyName: #PessimisticRR #validity: #installed )
</methods> <methods> Oracle7Context class <category>class initialization</category>
initialize "Initialize class instance variables." "Oracle7Context initialize" shortSize := 2000. maxColumnSize := 2147483647. maxNameSize := 30. (transactionPolicies := IdentitySet new) add: #PessimisticRR. self initializeBasicTypes. dataTypeMappings := OrderedCollection new. (self mapFieldOf: #String to: 'varchar2') maxSize: shortSize. (self mapFieldOf: #String to: 'char') maxSize: shortSize. (self mapFieldOf: #String to: 'long') maxSize: maxColumnSize; makeLong. (self mapFieldOf: #ByteArray to: 'raw') maxSize: shortSize. (self mapFieldOf: #ByteArray to: 'long raw') maxSize: maxColumnSize; makeLong. (self mapFieldOf: #Integer to: 'number'). (self mapFieldOf: #FixedPoint to: 'number'). (self mapFieldOf: #Float to: 'number'). (self mapFieldOf: #Double to: 'number'). (self mapFieldOf: #SerialNumber to: 'number'). (self mapFieldOf: #Double to: 'float'). (self mapFieldOf: #Float to: 'float'). (self mapFieldOf: #Timestamp to: 'date'). (self mapFieldOf: #String to: 'clob') maxSize: maxColumnSize; makeLong. (self mapFieldOf: #ByteArray to: 'blob') maxSize: maxColumnSize; makeLong. reservedWords := #('access' 'add' 'all' 'alter' 'and' 'any' 'as' 'asc' 'audit' 'between' 'by' 'char' 'check' 'cluster' 'column' 'comment' 'compress' 'connect' 'create' 'current' 'date' 'dba' 'decimal' 'default' 'delete' 'desc' 'distinct' 'double' 'drop' 'else' 'exclusive' 'exists' 'file' 'float' 'for' 'from' 'grant' 'group' 'having' 'identified' 'immediate' 'in' 'increment' 'index' 'initial' 'insert' 'integer' 'intersect' 'into' 'is' 'level' 'like' 'lock' 'long' 'maxextents' 'minus' 'mlslabel' 'mode' 'modify' 'noaudit' 'nocompress' 'not' 'nowait' 'null' 'number' 'of' 'offline' 'on' 'online' 'option' 'or' 'order' 'pctfree' 'prior' 'privileges' 'public' 'raw' 'rename' 'resource' 'revoke' 'row' 'rowid' 'rowlabel' 'rownum' 'rows' 'select' 'session' 'set' 'share' 'size' 'smallint' 'start' 'successful' 'synonym' 'sysdate' 'table' 'then' 'to' 'trigger' 'uid' 'union' 'unique' 'update' 'user' 'validate' 'values' 'varchar' 'varchar2' 'view' 'whenever' 'where' 'with' 'clob' 'blob'). self initializeCatalogDataModel.
initializeBasicTypes "Initialize basicTypes" "Oracle7Context initializeBasicTypes" super initializeBasicTypes. "These two types are overridden for Oracle7." self addBasicType: (LensEncodedType new name: #Symbol; memberClass: Symbol; fieldType: (self typeNamed: #String); encodeSelector: nil; decodeSelector: #asSymbol); addBasicType: (LensEncodedType new name: #Boolean; memberClass: Boolean; fieldType: ((self typeNamed: #String) copy maxColumnConstraint: 1); encodeSelector: #printStringForOracle; decodeSelector: #asBooleanForOracle)
</methods> <methods> Oracle7Constraint <category>accessing</category>
constraintName "Answer the receiver's constraintName." ^constraintName
constraintType "Answer the receiver's constraintType." ^constraintType
owner "Answer the receiver's owner." ^owner
referencedConstraint "Answer the receiver's referencedConstraint." ^referencedConstraint
table "Answer the receiver's table." ^table
</methods> <methods> Oracle7Index <category>accessing</category>
owner "Answer the receiver's owner." ^owner
table "Answer the receiver's table." ^table
uniqueness "Answer the receiver's uniqueness." ^uniqueness
</methods> <methods> Oracle7Index <category>testing</category>
isUnique "Answer whether receiver represents a unique index in database." ^self uniqueness = 'UNIQUE'
</methods> <methods> Oracle7Index class <category>private</category>
encodedAspects "Default encoded aspects to all instvars." ^#(#owner #table #uniqueness)
</methods> <methods> Core.String <category>private-oracle-or</category>
asBooleanForOracle "Try to interpret the string as a Boolean using a common Cobol paradigm. Treat the value as null if it doesn't match the encoded value for true or false." self size == 1 ifTrue: [ self = 'Y' ifTrue: [ ^true ]. self = 'N' ifTrue: [ ^false ] ]. ^nil
</methods> <methods> Database.OracleColumnDescription <category>accessing</category>
tableName "Answer the name of the table that this column belongs to. A nil indicates that the table name is not known." ^tableName
</methods> <methods> Database.OracleSession <category>private-ObjectLens</category>
bindInput: object template: template to: bindStream "Recursively flatten a template onto a bindStream" | class | ( object == nil ) ifTrue: [ ^self bindNil: template to: bindStream ]. ( template isInteger ) ifTrue: [ ^bindStream nextPut: object ]. class := template class. ( class == Object ) ifTrue: [ ^self ]. ( class == Float or: [ class == Double or: [ class == FixedPoint or: [ class == Timestamp or: [ object == true or: [ object == false or: [ (object isKindOf: CharacterArray) or: [ object isKindOf: ByteArray ] ] ] ] ] ] ] ) ifTrue: [ ^bindStream nextPut: object ]. ( ( template isKindOf: Array ) or: [ template isKindOf: OrderedCollection ] ) ifTrue: [ 1 to: object size do: [ : index | self bindInput: (object at: index) template: (template at: index) to: bindStream ] ] ifFalse: [ "All others are treated as instances" 1 to: object class instSize do: [ : index | self bindInput: (object instVarAt: index) template: (template instVarAt: index) to: bindStream ] ].
bindNil: template to: bindStream "Recursively bind nil against a template" | class | ( template == nil ) ifTrue: [ ^bindStream nextPut: nil ]. ( template isInteger ) ifTrue: [ ^bindStream nextPut: nil ]. class := template class. ( class == Object ) ifTrue: [ ^self ]. ( class == Float or: [ class == Double or: [ class == FixedPoint or: [ class == Timestamp or: [ class == ByteFieldDescriptor or: [ (template isKindOf: CharacterArray) or: [ template isKindOf: ByteArray ] ] ] ] ] ] ) ifTrue: [ ^bindStream nextPut: nil ]. "Recusively bind nil for Arrays, OrderedCollections, and other instances" ( ( template isKindOf: Array) or: [ template isKindOf: OrderedCollection ] ) ifTrue: [ 1 to: (template size) do: [ :index | self bindNil: (template at: index) to: bindStream ] ] ifFalse: [ "All other cases are treated as instances" 1 to: (template class instSize) do: [ :index | self bindNil: (template instVarAt: index) to: bindStream ] ]
flattenResultTemplate: template onto: descStream "Flatten an ObjectLens result template." | class desc | class := template class. "Instances of object in the template denote slots to ignore." ( class == Object ) ifTrue: [ ^self ]. (desc := OracleColumnDescription new) nullable: 1. template isInteger ifTrue: [ desc dbsize: 22; internalType: 2; "NUMBER" precision: 38. ^descStream nextPut: desc ]. class == FixedPoint ifTrue: [ desc dbsize: 22; internalType: 2. "NUMBER" ^descStream nextPut: desc ]. class == Float ifTrue: [ desc dbsize: 22; internalType: 2; "NUMBER" precision: 26; scale: -127. ^descStream nextPut: desc ]. class == Double ifTrue: [ desc dbsize: 22; internalType: 2; "NUMBER" precision: 46; scale: -127. ^descStream nextPut: desc ]. "Booleans never show up in the template. They are encoded and show up as a ByteFieldDescriptor." ( class == Timestamp ) ifTrue: [ desc dbsize: 7; internalType: 12. "DATE" ^descStream nextPut: desc ]. ( class == ByteFieldDescriptor ) ifTrue: [ desc internalType: (template Template isString ifTrue: [ 1 "VARCHAR2" ] ifFalse: [ 23 "RAW" ]); dbsize: template MaxColumnConstraint. ^descStream nextPut: desc ]. ( template isKindOf: CharacterArray ) ifTrue: [ template size == 0 ifTrue: [ desc dbsize: nil; internalType: 8 "LONG" ] ifFalse: [ self error: (#errNonEmptyString << #oracleDB >> 'Non-empty String in result template')]. (template isString and: [template isSymbol not]) ifFalse: [ self error: (#errNonStringInResultTemplate << #oracleDB >> 'non-String in result template'). ]. ^descStream nextPut: desc ]. "Decompose Arrays and Collections" ( (template isKindOf: Array) or: [ template isKindOf: OrderedCollection ] ) ifTrue: [ 1 to: template size do: [ :index | self flattenResultTemplate: (template at: index) onto: descStream ]. ^self ]. "All others are treated as instances of some entity." 1 to: template class instSize do: [ :index | self flattenResultTemplate: (template instVarAt: index) onto: descStream ].
nextSequenceNumberFor: sequenceName "Answer the next sequence number for the indicated sequence." | command number | command := Lens.DatabaseCommand new. command queryString: 'select ' , sequenceName , '.nextval from sys.dual'. command resultTemplate: 0. self doCommand: command. number := self answerAfterCommand next. self cancel. ^number
nextViaTemplate: template "Answer the object formed by reifying the template using a fetched row" | class object | ( template isInteger ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object isNil ifTrue: [ nil ] ifFalse: [ object asInteger ] ]. class := template class. ( class == Float ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object isNil ifTrue: [ nil ] ifFalse: [ object asFloat ] ]. ( class == Double ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object isNil ifTrue: [ nil ] ifFalse: [ object asDouble] ]. ( class == FixedPoint ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object isNil ifTrue: [ nil ] ifFalse: [ object isInteger ifTrue: [ object asFixedPoint: 2 ] ifFalse: [ object ] ] ]. ( class == Timestamp or: [ template == true or: [ template == false ] ] ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object ]. ( class == ByteFieldDescriptor or: [template isString and: [template isSymbol not]] ) ifTrue: [ object := self getFieldExternal: bufferIndex. bufferIndex := bufferIndex + 1. ^object ]. ( template isKindOf: Collection ) ifTrue: [ ( template isKindOf: Array ) ifTrue: [ ^self nextViaArrayTemplate: template ] ifFalse: [ ^self nextViaCollectionTemplate: template ] ]. ( class == Object ) ifTrue: [ ^nil ]. ^self nextViaEntityTemplate: template
</methods> <initialize> Oracle7Transporter </initialize> <initialize> Oracle7Context </initialize> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>OracleColumnDescription</name> <environment>Database</environment> <super>Database.ExternalDatabaseColumnDescription</super> <private>false</private> none dbsize internalType tableOwner tableName <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <class> <name>LensDatabaseIndex</name> <environment>Lens</environment> <super>Lens.LensMetadata</super> <private>false</private> none name indexedVariables <imports></imports> <category>Lens-Private-Database Context</category> <attributes> <package>Lens-Runtime</package> </attributes> </class> <class> <name>OracleSession</name> <environment>Database</environment> <super>Database.ExternalDatabaseSession</super> <private>false</private> none resultsCache hstmtHolder herrHolder bindValuePointersHolder maxLongBytes queryIsPLSQL currentRowIndex totalRows rowsInBlock dependentLobs sqlPointerHolder maxBindSize needBinding <imports></imports> <category>Database-Oracle</category> <attributes> <package>OracleEXDI</package> </attributes> </class> <class> <name>LensDatabaseTable</name> <environment>Lens</environment> <super>Lens.LensMetadata</super> <private>false</private> none <imports></imports> <category>Lens-Private-Database Context</category> <attributes> <package>Lens-Runtime</package> </attributes> </class> <class> <name>LensDatabaseContext</name> <environment>Lens</environment> <super>Lens.LensMetadata</super> <private>false</private> none username environment catalogDataModel dataTypeMappings maxColumnSize maxNameSize reservedWords basicTypes shortSize transactionPolicies <imports></imports> <category>Lens-Private-Database Context</category> <attributes> <package>Lens-Runtime</package> </attributes> </class> <class> <name>String</name> <environment>Core</environment> <super>Core.CharacterArray</super> <private>false</private> none <imports></imports> <category>Collections-Text</category> <attributes> <package>Collections-Text</package> </attributes> </class> <class> <name>LensSQLTransporter</name> <environment>Lens</environment> <super>Lens.LensBasicTransporter</super> <private>false</private> none selectFieldList whereCondition commandStream command objectSurrogateIndices joinLinks variableIndex numberOfIdVariables itemSurrogate variableBindings functions <imports></imports> <category>Lens-Private-Transporter</category> <attributes> <package>Lens-Runtime</package> </attributes> </class> <class> <name>LensDatabaseTableColumn</name> <environment>Lens</environment> <super>Lens.LensMetadata</super> <private>false</private> none <imports></imports> <category>Lens-Private-Database Context</category> <attributes> <package>Lens-Runtime</package> </attributes> </class>