liveBook · Manning

Automated persistence

As explained in Java Persistence with Spring Data and Hibernate epub

Automated persistence is a persistence solution that handles low-level database interaction and persistence mechanics on behalf of application code.

Automated persistence delegates low-level database work to a persistence solution, reducing the need to write SQL statements or use the JDBC API directly. The solution combines domain metadata, a persistence layer, and a persistence mechanism. section 3.2.2

Automation works alongside transparent persistence. Transparent persistence keeps domain classes independent of the persistence mechanism, while automation removes mechanical database tasks from application code. The two goals reduce persistence-related leakage without making the solution completely invisible. section 3.2.2 section 3.2.1

Automated persistence commonly provides these application-level consequences:

  • Keeps complex business logic from managing the persistence state of entity instances during ordinary execution. section 3.2.2
  • Allows persistent classes to avoid direct runtime dependencies on Jakarta Persistence or Hibernate APIs. section 3.2.2
  • Supports ordinary Java construction and reuse of persistent classes in unit tests or presentation code. section 3.2.2
  • Still imposes framework requirements, so automation does not mean that persistence concerns disappear entirely. section 3.2.2

Using a persistent domain class outside persistence

An Item domain object can be created with the regular Java new operator and used in a unit test for shipping cost and tax without loading it from or storing it in a database. Persistence remains external to the object, while the persistence solution handles database interaction elsewhere. section 3.2.2 section 3.2.1

How Java Persistence with Spring Data and Hibernate epub covers it

How deep it goes
Explains delegation, class independence, and remaining framework requirements without detailing provider configuration or lifecycle internals.
Examples
Uses the Item domain class, ordinary Java construction, and unit tests for shipping cost and tax.
What you can do after
Evaluate persistence designs by separating domain behavior from database mechanics while recognizing unavoidable framework requirements.
How it connects
Connects automated persistence with transparent persistence, object-relational mapping, JPA, Hibernate, metadata, and persistence managers.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Java Persistence with Spring Data and Hibernate epub. The section links point to the parts of the book it draws on.