home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / next / programm / 5968 < prev    next >
Encoding:
Text File  |  1992-09-03  |  2.3 KB  |  63 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!decwrl!csus.edu!netcom.com!yikes
  3. From: yikes@netcom.com (Jenny Doll)
  4. Subject: Re: DBKit API questions
  5. Message-ID: <vbmnsq.yikes@netcom.com>
  6. Date: Fri, 04 Sep 92 06:57:05 GMT
  7. Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
  8. References: <+alnfk#.yikes@netcom.com> <1992Sep4.005823.8849@u.washington.edu>
  9. Sender: yikes@netcom.com (Michael Brill) 
  10. Lines: 51
  11.  
  12. The Oracle writes:
  13.  
  14. >What you'd really like to do here is use the custom object interface in DBKit.
  15. >You can't, however, because of a SybaseAdaptor bug.
  16.  
  17. Does this mean I cannot current save and retrieve objects (say a List) 
  18. to/from Sybase?
  19.  
  20. >Another way to do this would be to create a custom Association subclass, which 
  21.  
  22. >converts your int to a date or time string on the fly.  You'd then hook two of 
  23.  
  24. >these custom Associations to the integer date property, and you'd be rocking.
  25.  
  26. >The trick is to hook up all of your associations in IB, and then replace the  
  27. >date ones with your custom versions at run time.
  28.  
  29. I just spent two hours going over all three pages of DBAssocation documentation
  30. and I just ain't getting it.  I think I understand the concept of a
  31. DBAssociation, but this is my third day of DBKit and I'm still not quite clear
  32. on how all of this stuff works together.  What I tried was...
  33.  
  34. Using the standard Sybase pubs demo, I created a subclass of DBAssociation and
  35. overode methods for:
  36.  
  37. - initFetchGroup:aFetchGroup expression:anExpr destination:aDest;
  38. - contentsDidChange;
  39. - currentRecordDidDelete;
  40. - endEditing;
  41. - getValue:aValue;
  42. - (unsigned)selectedRowAfter:(unsigned)previousRow;
  43. - selectionDidChange;
  44. - setDestination:newDestination;
  45. - setValue:aValue;
  46. - validateEditing;
  47.  
  48. In initFetchGroup:::, I said:
  49. [super initFetchGroup:aFetchGroup expression:anExpr destination:myUIObject];
  50.  
  51. In IB, I dropped a last name field into my instantiated subclassed DBAssociation
  52. , then I dragged
  53. a connection from my instantiated subclassed DBAssociation to a column in 
  54. a DBTable.  None of this really matters, because initFetchGroup never gets calle
  55. d, nor do
  56. any of the other methods.  BTW, what's the difference between getValue: and setV
  57. alue:?
  58.  
  59. Do you know of any code examples that highlight the use of DBAssociations?
  60.  
  61. Thanks, ...Michael (hmmm, flat files aren't all that bad afterall) Brill :/
  62.  
  63.