目前,在我们实际开发中还缺乏对JPA应用的最佳实践,本文来自Vincent Partington ,他在实践中总结了诸多JPA优秀的设计模式,本系列将谈论他的12个在JPA中的设计模式。
基本的设计模式:
1. Data Access Objects.
2.Saving(detached)entities
3. Retrieving entities.
4. Removing entitids.
5. Service Faceds and Data Transfers Objects.
高级的设计模式
6. Bidirectional Assocations
7. Lazy Loading
8. Bidrectional associations VS lazy loading
9. Using UUIDs as primary key
10. Field access VS property access
11. Mapping inheritance hierarchies
12. Testing.