home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / dbkit / DBRecordList.h < prev    next >
Text File  |  1992-06-19  |  3KB  |  96 lines

  1. /*
  2. **      DBRecordList.h
  3. **      Database Kit, Release 3.0
  4. **      Copyright (c) 1992, NeXT Computer, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <dbkit/DBRecordStream.h>
  8. #import <dbkit/protocols.h>
  9. #import <dbkit/enums.h>
  10.  
  11. @class List;
  12. @class DBDatabase;
  13. @class DBQualifier;
  14. @class DBValue;
  15.  
  16. /*
  17. ** Emptying, initing, or fetching recor$    Gnto the RecordList will reset
  18. **  it to a "unmodified" state.  After this point, modifications are tracked
  19. **  until the recordList is refilled or a saveModifications is received.
  20. **
  21. ** If there is no transaction in progress for the RecordList's database, and
  22. **  autosave mode is not enabled, saveModifications will create
  23. **  a transaction context and attempt to perform the modifications.  If one
  24. **  fails, the entire transaction is rolled back.
  25. **
  26. ** If there is already a transaction in progress for the RecordList's database,
  27. **  the modifications will be attempted in that transaction context (no new
  28. **  transaction is generated).
  29. **
  30. ** When notification of failure is sent to the delegate, the recordList's
  31. **  "cursor" will be positioned on the row that is failing -- any rows that
  32. **  fail will be "dirty" after the saveModifications has completed.  This
  33. **  combination of events let's you go back and fix failures, and then
  34. **  resubmit.
  35. */
  36.  
  37. @interface DBRecordList : DBRecordStream <DBCursorPositioning, DBContainers>
  38. {
  39. @private
  40.   id _rowList;
  41.   id _insertedList;
  42.   id _deletedList;
  43.  
  44.   unsigned _currentRow;
  45.   unsigned _mode;
  46. }
  47.  
  48. - init;
  49. - clear;
  50. - free;
  51.  
  52. - fetchUsingQualifier:(DBQualifier*)aQualifier;
  53. - fetchUsingQualifier:(DBQualifier*)aQualifier empty:(BOOL)emptyFirst;
  54. - fetchRecordForRecordKey:(DBValue*)aValue;
  55.  
  56. - setRetrieveMode:(DBRecordListRetrieveMode)aMode;
  57. - (DBRecordListRetrieveMode)currentRetrieveMode;
  58.  
  59. - (BOOL)isModified;
  60. - (BOOL)isModifiedAt:(unsigned)index;
  61. - (BOOL)isModifiedForProperty:property at:(unsigned)index;
  62. - (BOOL)isNewRecord;
  63. - (BOOL)isNewRecordAt:(unsigned)index;
  64.  
  65. /*
  66. ** saveModifications returns the number of records successfully modified and
  67. **  sent to the database, or DB_NoIndex on catastrophe.
  68. */
  69. - (unsigned)saveModifications;
  70.  
  71. /*
  72. ** Array style access
  73. */
  74. - getValue:(DBValue*)aValue forProperty:aProperty;
  75. - getValue:(DBValue*)aValue forProperty:aProperty at:(unsigned)index;
  76. - setValue:(DBValue*)aValue forProperty:aProperty;
  77. - setValue:(DBValue*)aValue forProperty:aProperty at:(unsigned)index;
  78.  
  79. - getRecordKeyValue:(DBValue*)aValue;
  80. - getRecordKeyValue:(DBValue*)aValue at:(unsigned)index;
  81. - (unsigned)positionForRecordKey:(DBValue*)aValue;
  82.  
  83. - newRecord;
  84. - appendRecord;
  85. - insertRecordAt:(unsigned)index;
  86. - deleteRecord;
  87. - deleteRecordAt:(unsigned)index;
  88. - moveRecordAt:(unsigned)sourceIn$    Hto:(unsigned)destinationIndex;
  89. - swapRecordAt:(unsigned)anIndex withRecordAt:(unsigned)anotherIndex;
  90.  
  91. - (unsigned)recordLimit;
  92. - setRecordLimit:(unsigned)aRecordCount;
  93.  
  94. @end
  95.  
  96.