home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / EOImplementationFile.template < prev    next >
Text File  |  1996-09-12  |  2KB  |  90 lines

  1. // $entity.className$
  2. //
  3. // Created on $date$ by NeXT EOModeler.app Version $eomVersion$
  4.  
  5. #import "$entity.className$.h"
  6.  
  7. ##loop $entity.referencedClasses$
  8. #import "$property$.h"
  9. ##end
  10.  
  11. @implementation $entity.className$
  12.  
  13. ##loop $entity.classScalarAttributes$
  14. - (void)set$property.name$:($property.cScalarTypeString$) value
  15. {
  16.     [self willChange];
  17.     $property.name$ = value;
  18. }
  19. - ($property.cScalarTypeString$) $property.name$ { return $property.name$; }
  20.  
  21. ##end
  22. ##loop $entity.classNonScalarAttributes$
  23. - (void)set$property.name$:($property.valueClassName$ *)value
  24. {
  25.     [self willChange];
  26.     [$property.name$ autorelease];
  27.     $property.name$ = [value retain];
  28. }
  29. - ($property.valueClassName$ *)$property.name$ { return $property.name$; }
  30.  
  31. ##end
  32. ##// instead of scalar/nonScalar you could use:
  33. ##// ##loop $entity.classAttributes$
  34. ##// - (void)set$property.name$:($property.valueClassName$ *)value
  35. ##// {
  36. ##//     [self willChange];
  37. ##//     [$property.name$ autorelease];
  38. ##//     $property.name$ = [value retain];
  39. ##// }
  40. ##// - ($property.valueClassName$ *)$property.name$ { return $property.name$; }
  41. ##// ##end
  42. ##loop $entity.classToOneRelationships$
  43. - (void)set$property.name$:($property.destinationEntity.referenceClassName$)value
  44. {
  45.     // a to-one relationship
  46.     [self willChange];
  47.     [$property.name$ autorelease];
  48.     $property.name$ = [value retain];
  49. }
  50. - ($property.destinationEntity.referenceClassName$)$property.name$ { return $property.name$; }
  51.  
  52. ##end
  53. ##loop $entity.classToManyRelationships$
  54. - (void)addTo$property.name$:($property.destinationEntity.referenceClassName$)object
  55. {
  56.     // a to-many relationship
  57.     [self willChange];
  58.     [$property.name$ addObject:object];
  59. }
  60. - (void)removeFrom$property.name$:($property.destinationEntity.referenceClassName$)object
  61. {
  62.     // a to-many relationship
  63.     [self willChange];
  64.     [$property.name$ removeObject:object];
  65. }
  66. - (NSArray *)$property.name$ { return $property.name$; }
  67.  
  68. ##end
  69.  
  70. - (void)dealloc
  71. {
  72. ##loop $entity.classNonScalarAttributes$
  73.     [$property.name$ release];
  74. ##end
  75. ##// instead of scalar/nonScalar you could use:
  76. ##// ##loop $entity.classAttributes$
  77. ##//    [$property.name$ release];
  78. ##// ##end
  79. ##loop $entity.classToOneRelationships$
  80.     [$property.name$ release];
  81. ##end
  82. ##loop $entity.classToManyRelationships$
  83.     [$property.name$ release];
  84. ##end
  85.     
  86.     [super dealloc];
  87. }
  88.  
  89. @end
  90.