Inherits from: NSObject
Package: com.apple.yellow.eoaccess
An EOModel represents a mapping between a database schema and a set of classes based on the entity-relationship model. The model contains a number of EOEntity objects representing the entities (tables) of the database schema. Each EOEntity object has a number of EOAttribute and EORelationship objects representing the properties (columns or fields) of the entity in the database schema. For more information on attributes and relationships, see their respective class specifications.
An EOModel maintains a mapping between each of its EOEntity objects and a corresponding enterprise object class for use with the database level of the Enterprise Objects Framework. You can determine the EOEntity for a particular enterprise object with the entityForObject method.
An EOModel is specific to a particular database server, and stores information needed to connect to that server. This includes the name of an adaptor framework to load so that the Enterprise Objects Framework can communicate with the database. Models are stored in the file system in a manner similar to adaptor framework. EOModel objects are usually loaded from model files built with the EOModeler application rather than built programmatically. If you need to programmatically load a model file, see the section "Loading a Model File" .
Models can have relationships that reference other models in the same model group. The other models may map to different databases and types of servers.
Models are organized into model groups; see the EOModelGroup class specification for more information.
The EOAdaptorChannel class declares methods for reading basic schema information from a relational database. You can use this information to build up an EOModel programmatically, and then enhance that model by defining extra relationships, flattening attributes, and so on. See the class description in the EOAdaptorChannel class specification for information on reading basic schema information, and see the other modeling classes' specifications for information on creating additional attributes and relationships.
EOModel defines a String constant for the name of the notification it posts. For more information, see "Notifications" .
- Constructors
- EOModel
- Saving a model
- encodeTableOfContentsIntoPropertyList
- writeToFile
- Loading a model's objects
- loadAllModelObjects
- Working with entities
- addEntity
- removeEntity
- removeEntityAndReferences
- entityNames
- entityNamed
- entities
- entitiesWithSharedObjects
- Naming a model's components
- beautifyNames
- Accessing the model's name
- setName
- name
- path
- Checking references
- referencesToProperty
- externalModelsReferenced
- Getting an object's entity
- entityForObject
- Accessing the adaptor bundle
- adaptorName
- setAdaptorName
- Accessing the connection dictionary
- setConnectionDictionary
- connectionDictionary
- Accessing the user dictionary
- setUserInfo
- userInfo
- Working with stored procedures
- addStoredProcedure
- removeStoredProcedure
- storedProcedureNames
- storedProcedureNamed
- storedProcedures
- Accessing the model's group
- setModelGroup
- modelGroup
- Accessing prototype attributes
- availablePrototypeAttributeNames
- prototypeAttributeNamed
public EOModel(String path)
public EOModel(
NSDictionary tableOfContents,
String path)
See Also: name, path, encodeTableOfContentsIntoPropertyList
public String adaptorName()
public void addEntity(EOEntity anEntity)
exception
if
an error occurs (for example, if anEntity doesn't exist,
if the entity belongs to another model, or if an entity of the same
name is already in the receiver).See Also: entities, removeEntity, removeEntityAndReferences
public void addStoredProcedure(EOStoredProcedure storedProcedure)
See Also: removeStoredProcedure, storedProcedures, storedProcedureNamed
public NSArray availablePrototypeAttributeNames()
See Also: prototypeAttributeNamed
public void beautifyNames()
See Also: nameForExternalName (EOEntity), beautifyName ( EOEntity, EOAttribute, EORelationship, EOStoredProcedure), name
public NSDictionary connectionDictionary()
public void encodeTableOfContentsIntoPropertyList(NSMutableDictionary propertyList)
See Also: EOModel constructors
public NSArray entities()
See Also: entityNames
public NSArray entitiesWithSharedObjects()
public EOEntity entityForObject(Object anEO)
public EOEntity entityNamed(String name)
See Also: entityNames, entities
public NSArray entityNames()
See Also: entities, entityNamed
public NSArray externalModelsReferenced()
See Also: referencesToProperty
public void loadAllModelObjects()
See Also: attributes (EOEntity), entities, relationships (EOEntity), storedProcedures
public EOModelGroup modelGroup()
See Also: setModelGroup
public String name()
See Also: path, EOModel constructors
public String path()
See Also: name, EOModel constructors
public EOAttribute prototypeAttributeNamed(String attributeName)
See Also: availablePrototypeAttributeNames
public NSArray referencesToProperty(Object aProperty)
See Also: externalModelsReferenced
public void removeEntity(EOEntity name)
See Also: addEntity, removeEntityAndReferences
public void removeEntityAndReferences(EOEntity entity)
See Also: removeEntity, addEntity
public void removeStoredProcedure(EOStoredProcedure storedProcedure)
See Also: addStoredProcedure, storedProcedures
public void setAdaptorName(String adaptorName)
See Also: availableAdaptorNames (EOAdaptor)
public void setConnectionDictionary(NSDictionary connectionDictionary)
See Also: adaptorWithModel (EOAdaptor)
public void setModelGroup(EOModelGroup group)
See Also: modelGroup
public void setName(String name)
public void setUserInfo(NSDictionary dictionary)
public EOStoredProcedure storedProcedureNamed(String name)
See Also: storedProcedureNames, storedProcedures
public NSArray storedProcedureNames()
See Also: storedProcedureNamed, storedProcedures
public NSArray storedProcedures()
See Also: storedProcedureNames, storedProcedureNamed
public NSDictionary userInfo()
See Also: setUserInfo
public void writeToFile(String path)
Throws an exception on any error which prevents the file from being written.
See Also: path
EOModel declares and posts the following notification.
Notification Object | The entity that was loaded. |
Userinfo | None |