|
|
|
|
|
|
|
| ![]() |
|
| ![]() |
|
| |
|
|
|
| |
|
| ![]() | ||
|
|
|
![](https://i-blog.csdnimg.cn/blog_migrate/cf1ff2ec01658e1a6550ae22b211fa2a.png)
![](https://i-blog.csdnimg.cn/blog_migrate/41cde247e9536d956dce849267069237.png)
![](https://i-blog.csdnimg.cn/blog_migrate/c52920c6df7a33daafa95ea75b3942f1.png)
|
|
|
|
|
|
|
|
| ![]() |
|
|
|
| ||
|
|
| 给了它一个EntityManager的代理 EntityManager并不是线程安全的,一般来讲并不适合注入到像Repository这样共享的单例bean中 | ||||
|
|
|
|
| |||
|
| @PersistenceUnit和@PersistenceContext并不是Spring的注解,它们是由JPA规范提供的 需要<context:annotation-config>或<context:component-scan>会自动注册PersistenceAnnotationBean-PostProcessor bean
否则的话,我们需要显式地注 册这个bean:
|
| ||||
|
|
|
|
|
| ||
|
| 使用Spring的数据异常体系 |
|
|
| ||
|
|
|
|
|
|
|
![](https://i-blog.csdnimg.cn/blog_migrate/91472c89f4fe476b7b5d0b56cc2c303e.png)