One-to-one relationship
A one-to-one relationship is an association in which each instance of either entity type relates to at most one instance of the other type.
Grokking Relational Database Design
A one-to-one relationship is a relationship in which each entity instance is associated with at most one instance of the other entity in both directions.
- How it is used
- Uses maximum cardinality to model entity pairs where neither side connects to more than one instance.
- How deep it goes
- Explains maximum and minimum cardinalities, notation, foreign-key placement, and insertion constraints.
- Examples
- Uses department-manager and dealer-address relationships to illustrate one-to-one associations.
- What you can do after
- Apply it to choose cardinalities, place a foreign key, and adjust optionality for workable data entry.
Read how Grokking Relational Database Design explains one-to-one relationship →
Java Persistence with Spring Data and Hibernate epub
A one-to-one association is an association in which each entity instance is related to at most one instance of the other entity type.
- How it is used
- Models exclusive associations between entity instances when each side may reference at most one instance of the other.
- How deep it goes
- Compares component, shared-primary-key, foreign-key, and join-table mappings, including schema constraints and lazy-loading behavior.
- Examples
- Uses User–Address mappings, an optional Shipment–Item link, SQL schemas, repository interfaces, annotations, and persistence tests.
- What you can do after
- Apply it via JPA annotations or Spring Data JDBC mappings while selecting storage based on lifecycle, identity, and optionality.
Read how Java Persistence with Spring Data and Hibernate epub explains one-to-one relationship →
Django in Action
A one-to-one relationship is a relationship in which each record on one side corresponds to at most one record on the other side.
- How it is used
- Separates extra user data from account data while preserving one profile per user.
- How deep it goes
- Implements the model field, deletion behavior, admin integration, and migration workflow without exploring database internals.
- Examples
- Uses RiffMates UserProfile, musician profiles, controlled venues, stacked inlines, and the Django Admin user screen.
- What you can do after
- Apply it via Django ORM and Django Admin to attach one profile model to each user account.
Read how Django in Action explains one-to-one relationship →
Related concepts
- @OneToOneconfigured by · @OneToOne is a Jakarta Persistence annotation that declares an entity-valued property as a one-to-one association.
- foreign keyuses · A foreign key is a column or set of columns in a relational table whose values reference a candidate key in the same or another table, establishing a relationship and supporting referential integrity.
- shared primary key valueincludes · A shared primary key value is a one-to-one mapping strategy in which associated entities use the same database primary-key value.
- minimum cardinalityconfigured by · Minimum cardinality is the smallest number of related entity instances required or permitted for an entity instance in a relationship.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


