这是环境设置和重要的依赖项:
以下代码在开发服务器上可以完美运行
@Entity
@Table(name = "table")
@SqlResultSetMappings({
@SqlResultSetMapping(name = "SqlResultSetMapping.count", columns = @ColumnResult(name = "cnt")),
@SqlResultSetMapping(name = "projection",
classes = {
@ConstructorResult(
targetClass = com.considion.itas.domain.Table.class,
columns = {})
})
@NamedNativeQueries({
@NamedNativeQuery(
name = "Table.request",
resultSetMapping = "projection",
query = "query"
),
@NamedNativeQuery(
name = "Table.request.count",
resultSetMapping = "SqlResultSetMapping.count",
query = " count request"
)
})
public class Table implements Serializable { ... }
,存储库如下所示:
public interface TableRepository extends JpaRepository<Table,Long>{
Page<Table> extract(@Param("para") ... , Pageable pageable);
}
但是一旦在生产环境中运行,glassFish会引发以下错误
Caused by: org.springframework.data.mapping.PropertyReferenceException: No property extract found for type Table!
at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:80) ~[spring-data-commons-1.13.15.RELEASE.jar:na]
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:336) ~[spring-data-commons-1.13.15.RELEASE.jar:na]
at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:312) ~[spring-data-commons-1.13.15.RELEASE.jar:na]