[Glorp-development] glorp problem - DictionaryMapping
Status: Pre-Alpha
Brought to you by:
alan_knight,
anthonylander,
boris_popov,
cdegroot,
and 4 others
From: Johannes B. <br...@no...> - 2007-07-03 20:56:53
|
Hi, I am a glorp newbie and to learn something about it I tried the examples from the tutorial of Roger Whitney. All works fine but the DictionaryMapping example does not. I get an error with the following descriptor: descriptorForAddressBook: aDescriptor | table linkTable | table := self tableNamed: 'ADDRESS_BOOK'. linkTable := self tableNamed: 'ADDRESS_BOOK_LINKS'. aDescriptor table: table. aDescriptor addMapping: (DirectMapping from: #id to: (table fieldNamed: 'id')). aDescriptor addMapping: (DirectMapping from: #title to: (table fieldNamed: 'title')). aDescriptor addMapping: ((DictionaryMapping new) attributeName: #entries; referenceClass: Person; keyField: (linkTable fieldNamed: 'person_key'); relevantLinkTableFields: (Array with: (linkTable fieldNamed: 'person_id'))) An error happens because the descriptor variable of DictionaryMapping is nil (s. top of stack below). I cannot figure out what is the cause. Any help? Johannes Unhandled exception: Message not understood: #system UndefinedObject(Object)>>doesNotUnderstand: Glorp.DictionaryMapping(Glorp.Mapping)>>system Glorp.DictionaryMapping>>associationDescriptor Glorp.DictionaryMapping>>newMapping: Glorp.DictionaryMapping>>keyField: GlorpTutorialDescriptor>>descriptorForAddressBook: GlorpTutorialDescriptor(Glorp.DescriptorSystem)>>initializeDescriptor: optimized [] in Glorp.DescriptorSystem>>descriptorFor: Dictionary>>at:ifAbsent: GlorpTutorialDescriptor(Glorp.DescriptorSystem)>>descriptorFor: optimized [] in Glorp.DescriptorSystem>>allDescriptors optimized [] in OrderedCollection>>collect: OrderedCollection>>do: OrderedCollection>>collect: GlorpTutorialDescriptor(Glorp.DescriptorSystem)>>allDescriptors GlorpTutorialDescriptor(Glorp.DescriptorSystem)>>validate Glorp.GlorpSession>>system: UndefinedObject>>unboundMethod UndefinedObject(Object)>>performMethod:arguments: UndefinedObject(Object)>>performMethod: TextEditorController(ParagraphEditor)>>evaluateCompiled: optimized [] in ParagraphEditor>>evaluateSelection BlockClosure>>ensure: Cursor>>showWhile: TextEditorController(ParagraphEditor)>>evaluateSelection optimized [] in ParagraphEditor>>doIt BlockClosure>>on:do: TextEditorController(ParagraphEditor)>>doIt WorkspacePage>>doIt Workbook(AbstractWorkspace)>>smalltalkDoIt optimized [] in ApplicationModel>>actionFor: optimized [] in ToolBar>>newButtonFor: PluggableAdaptor>>setValue: PluggableAdaptor(ValueModel)>>value: TriggerButtonController>>pressAction TriggerButtonTracker(BasicButtonTracker)>>finishSelectionFor: TriggerButtonTracker>>finishSelectionFor: TriggerButtonTracker(SelectionTracker)>>redButtonReleasedEvent: RedButtonReleasedEvent>>dispatchTo: TriggerButtonTracker(SelectionTracker)>>handleEvent: EventDispatcher>>dispatch:to: EventDispatcher>>dispatchEvent: RedButtonReleasedEvent(Event)>>dispatch RedButtonReleasedEvent(Event)>>dispatchForWindowManager: optimized [] in WindowManager>>safelyDispatchForWindowManager: BlockClosure>>on:do: WindowManager>>safelyDispatchForWindowManager: WindowManager>>processNextEvent optimized [] in [] in WindowManager>>newProcess BlockClosure>>on:do: optimized [] in WindowManager>>newProcess BlockClosure>>on:do: optimized [] in Process class>>forBlock:priority: ---------------------------------------------------------------------- UndefinedObject(Object)>>doesNotUnderstand: Receiver: an UndefinedObject Arguments: aMessage = a Message with selector: #system and arguments: #() Temporaries: excpt = a MessageNotUnderstood resumeValue = nil Context PC = 25 ---------------------------------------------------------------------- Glorp.DictionaryMapping(Glorp.Mapping)>>system Receiver: a Glorp.DictionaryMapping Instance Variables: descriptor = nil canRead = true canWrite = true attribute = ~~~~>>entries debugRead = false debugWrite = false query = nil join = nil usesLinkTable = true shouldProxy = true linkTableJoin = nil targetTableJoin = nil reverseJoin = nil shouldUseFilteredRead = false rowMapKeyConstructorBlock = nil controlsTables = true isExclusive = false linkFields = nil proxyAction = nil orderBy = nil shouldWriteTheOrderField = false keyMapping = nil valueMapping = nil associationDescriptor = a Glorp.Descriptor(a Glorp.Descriptor Context PC = 5 ---------------------------------------------------------------------- Glorp.DictionaryMapping>>associationDescriptor Receiver: a Glorp.DictionaryMapping Instance Variables: descriptor = nil canRead = true canWrite = true attribute = ~~~~>>entries debugRead = false debugWrite = false query = nil join = nil usesLinkTable = true shouldProxy = true linkTableJoin = nil targetTableJoin = nil reverseJoin = nil shouldUseFilteredRead = false rowMapKeyConstructorBlock = nil controlsTables = true isExclusive = false linkFields = nil proxyAction = nil orderBy = nil shouldWriteTheOrderField = false keyMapping = nil valueMapping = nil associationDescriptor = a Glorp.Descriptor(a Glorp.Descriptor Context PC = 15 |