Spring Persistence Concepts: Difference between revisions
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
=Repository= | =Repository= | ||
Any repository implementation needs access to a persistence resource, depending on the persistence technology used. For example, a JDBC-based repository needs access to a [[DataSource#Overview|JDBC DataSource]], while a JPA-based repository needs access to an [[JPA Concepts#EntityManager|EntityManager]]. | Any repository implementation needs access to a persistence resource, depending on the persistence technology used. For example, a JDBC-based repository needs access to a [[DataSource#Overview|JDBC DataSource]], while a JPA-based repository needs access to an [[JPA Concepts#EntityManager|EntityManager]]. A repository can be configured with XML, or the corresponding Java class can be annotated with [[@Repository]]. | ||
[[@Repository]] | |||
=Object IDs= | =Object IDs= | ||
* When persisting objects in a relational database, it is generally a good idea to have one field in the object that uniquely identifies the object. See [[Relational Databases#Object_IDs|Relational Databases]]. | * When persisting objects in a relational database, it is generally a good idea to have one field in the object that uniquely identifies the object. See [[Relational Databases#Object_IDs|Relational Databases]]. |
Revision as of 20:35, 14 October 2018
Internal
Overview
DAO
Repository
Any repository implementation needs access to a persistence resource, depending on the persistence technology used. For example, a JDBC-based repository needs access to a JDBC DataSource, while a JPA-based repository needs access to an EntityManager. A repository can be configured with XML, or the corresponding Java class can be annotated with @Repository.
Object IDs
- When persisting objects in a relational database, it is generally a good idea to have one field in the object that uniquely identifies the object. See Relational Databases.