我用的springboot+jpa+thymeleaf
1. BaseRepositoryFactory的getTargetRepository变了
原来的
@Override
protected Object getTargetRepository(RepositoryInformation information) {
return new BaseJpaRepository((Class)information.getDomainType(), em);
}
改为:
@Override
protected JpaRepositoryImplementation<?, ?> getTargetRepository(RepositoryInformation information,EntityManager entityManager) {
JpaEntityInformation<?, Serializable> entityInformation = this.getEntityInformation(information.getDomainType());
Object repository = this.getTargetRepositoryViaReflection(information, new Object[]{entityInformation, entityManager});
Assert.isInstanceOf(BaseJpaRepository.class, repository);
return (JpaRepositoryImplementation)repository;
}
2. 查询的排序变了
Sort sort = new Sort(Direction.ASC, "字段");
改为:
Sort sort = Sort.by(Sort.Direction.ASC, "字段");
3. thymeleaf的引用模板页不起作用了。所有页面都乱了。
引用模板的部分layout:decorator改成使用新的标签 layout:decorate 进行页面布局。
|