[[domain-model]]
== Domain Model
:sourcedir: extras

The term https://en.wikipedia.org/wiki/Domain_model[domain model] comes from the realm of data modeling.
It is the model that ultimately describes the https://en.wikipedia.org/wiki/Problem_domain[problem domain] you are working in.
Sometimes you will also hear the term _persistent classes_.

Ultimately the application domain model is the central character in an ORM.
They make up the classes you wish to map. Hibernate works best if these classes follow the Plain Old Java Object (POJO) / JavaBean programming model.
However, none of these rules are hard requirements.
Indeed, Hibernate assumes very little about the nature of your persistent objects. You can express a domain model in other ways (using trees of `java.util.Map` instances, for example).

Historically applications using Hibernate would have used its proprietary XML mapping file format for this purpose.
With the coming of JPA, most of this information is now defined in a way that is portable across ORM/JPA providers using annotations (and/or standardized XML format).
This chapter will focus on JPA mapping where possible.
For Hibernate mapping features not supported by JPA we will prefer Hibernate extension annotations.

include::types.adoc[]
include::naming.adoc[]
include::basic_types.adoc[]
include::embeddables.adoc[]
include::entity.adoc[]
include::access.adoc[]
include::identifiers.adoc[]
include::associations.adoc[]
include::collections.adoc[]
include::natural_id.adoc[]
include::dynamic_model.adoc[]
include::inheritance.adoc[]
include::immutability.adoc[]