Recently, I developed a data synchronization service with JPA. Because it involves multiple databases and operates multiple tables, I felt that Mybatis was too inefficient, so I tried to use JPA development; Because I used hibernate (via hbm. xml mapping) before, I walked through many holes in the middle. At the beginning, I was a bit nervous. After using it, I found that this JPA was really delicious:
- No mapping xml , directly through annoation realization
- adopt Repository realization CRUD function
- Directly support paging query
- Automatic generation and update of data tables
- Native support sql Query Mapping
Jpa's data mapping and CRUD are much more convenient than mybatis's, and the modification of data fields can be updated automatically, eliminating the trouble of manually operating the database.