EOModel *myModel; /* Assume this exists. */
NSArray *keyAttributes; /* Assume this exists. */
EOEntity *employeeEntity;
BOOL result;
employeeEntity = [[[EOEntity alloc] init] autorelease];
[employeeEntity setName:@"employee"];
[employeeEntity setExternalName:@"EMPLOYEE"];
[employeeEntity setClassName:@"Employee"];
/* Create at least the primary key attributes. */
result = [employeeEntity setPrimaryKeyAttributes:keyAttributes];
/* Add the entity to the model. */
[myModel addEntity:employeeEntity];