## 14 EOEntity class

### 14.1 overview

An entity contains information pertaining to a table in a database in the form of attributes and relationships.

Additionally an entity contains:

1. An array of class properties
2. An array of primary key attributes
3. A class name
4. An External name

### 14.2 Class properties

A class property of an entity can be either an attribute or a relationship. typically class properties are the set of attributes or relationships which are user visible and need to be set or accessed by the user. Primary and Foreign keys attributes are usually derived from other attributes or generated automatically and so they are not typically class properties.

A class property will be available through Key Value Coding for access and modification, in an instance of an Enterprise object.

### 14.3 Class name

an EOEntity’s class name represents the name of the class which will be instantiated when creating an Enterprise Object such as EOGenericRecord or a custom object.

### 14.4 Primary Key Attributes

Primary key attributes specify which attributes uniquely identify a row in the table, they are typically generated automatically by GDL2. They correspond directly to the relational database concept.

### 14.5 External name

The external name represents the table name in the database server, and in any SQL the adaptor might generate.