---
title: Configuring Entities
framework: coredata
role: article
role_heading: Article
path: coredata/configuring-entities
---

# Configuring Entities

Model your app’s objects.

## Overview

Overview An entity describes an object, including its name, attributes, and relationships. Create an entity for each of your app’s objects. Add Entities After you create a Core Data model as described in Creating a Core Data model, add an entity to your project’s .xcdatamodeld file: Click Add Entity at the bottom of the editor area. A new entity with placeholder name Entity appears in the Entities list. In the Entities list, double-click the newly added entity and rename it. This step updates both the entity name and class name visible in the Data Model inspector.

In addition to the required name and class name fields, entities have a default setting for the required code generation field. If you need to add inheritance, unique constraints, versioning, or other optional information, configure your entity as described below. Otherwise, add the properties that compose your entity as described in Configuring Attributes. Configure Entities Use the data model inspector (choose View > Inspectors > Show Data Model Inspector) to configure your entity. For information about the options for code generation, see Generating code. Unique constraints prevent duplicate records in the store. When saving a new record, the store checks whether any record already exists with the same value for the constrained attribute. In the case of a conflict, NSMergePolicyType.mergeByPropertyObjectTrumpMergePolicyType causes the new record to overwrite all fields in the existing record. For more information, see Core Spotlight. For more information, see Migrating your data model automatically.

## See Also

### Configuring a Core Data Model

- [Configuring Attributes](coredata/configuring-attributes.md)
- [Configuring Relationships](coredata/configuring-relationships.md)
- [Generating code](coredata/generating-code.md)
