[Spring] JPA, Repository
This post is focused on my Spring study
JPA
- Standard F/W of Java ORM
- Mapping RDB as a instance
JDBC –> Infinite loop in sql query required, infinite loop for Connections(open & close) Mybatis –> Infinite loop in sql query required, delegation for Connections(open & close) JPA –> automata for sql query, delegation for Connections(open & close)
Relationship with Hibernate
- IF JPA is Dance then –> Hibernate is a dancer.
- JPA is a one of APIs and it follows Java Platform RDMS.
- Hibernate is a ORM library and it follows JPA Spec
Repository
Description
- Product class provides Getter and Setter
- ProductRepository is extended with JPARepository<Product, String>
- real methods perform in RepositoryApplication
- extra setting is required(ex. H2 DB) in application.properties