Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > EOAccess Reference

Table of Contents

NSString Additions


Category of: NSString
Declared in: EOAccess/EOEntity.h




Category Description


The access layer adds two methods to the NSString class, to enable the conversion of modeling object names to database schema names, and database schema names to modeling object names.




Class Methods



externalNameForInternalName:separatorString:useAllCaps:

+ (NSString *)externalNameForInternalName:(NSString *)name, separatorString:(NSString *)separatorString, useAllCaps:(BOOL)useAllCaps)

Used by the Framework to convert modeling object names to database schema names that conform to a standard convention. A conforming database schema name is upper-case and uses "_" to separate words. Consequently "name" becomes "NAME" and "firstName" becomes "FIRST_NAME".

separatorString is a character that is used to separate words. The Framework uses "_" by default as in the examples above. useAllCaps indicates whether to capitalize the name. For example, providing NO converts "firstName" to "first_name".



nameForExternalName:separatorString:initialCaps:

+ (NSString *)nameForExternalName:(NSString *)name, separatorString:(NSString *)separatorString, initialCaps:(BOOL)initialCaps)

Used by name beautification to convert database schema names to modeling object names that conform to a standard convention. A conforming attribute, relationship, or stored procedure name is lower-case except for the initial letter of each embedded word other than the first. Consequently "NAME" becomes "name" and "FIRST_NAME" becomes "firstName". A conforming entity is all lower-case except for the initial letter of each word. Consequently "CUSTOMER_ACCOUNT" becomes "CustomerAccount".

separatorString is a character that is used to separate words. The Framework uses "_" by default as in the examples above. initialCaps indicates whether to capitalize the first letter of the first word. By default, the Framework uses YES for entities and NO for everything else.

See Also: - beautifyNames (EOModel), - beautifyName ( EOAttribute, EOEntity, EORelationship, EOStoredProcedure)




Table of Contents