我的实体注释如下:
public List<Long> findByCountryId(Long countryId, Pageable pageable) {
JPAQuery<Long> query = new JPAQuery<>(this.entityManager);
// innerJoins, where, ...
query
.offset(pageable.getOffset())
.limit(pageable.getPageSize());
return query.fetch();
}
它们作为Maven依赖项位于共享库中。该表名在一个Spring Boot应用程序中使用,但在另一个应用程序中不使用,唯一明显的区别是Spring 1.5与Spring 2.0
第一个应用程序正确生成查询,例如“ SELECT * FROM actual_table;”。而第二个应用程序正在生成“ SELECT * FROM mytable;”之类的查询。
调试代码表明,有一个元数据对象向下传递到获取表名的堆栈中。我只是无法说出为什么此元数据在第二个应用程序中具有错误的值。