Spring Data Commons 提供了 Page 接口,它是一个可分页的数据结果表示。Page 接口提供了一个标准化的方式来表示请求数据的可分页结果集,包括当前页码、总页数、总元素数和实际的元素列表。这使得在 Spring Data 存储库中进行分页操作变得很简单,无需开发人员编写自定义代码。

Namespace reference

The <repositories /> Element

<repositories />`元素触发 Spring Data 存储库基础架构的设置。最重要的属性是 `base-package,它定义要扫描 Spring Data 存储库界面的包。请参见 “XML Configuration”。下表描述了 `<repositories />`元素的属性:

The <repositories /> element triggers the setup of the Spring Data repository infrastructure. The most important attribute is base-package, which defines the package to scan for Spring Data repository interfaces. See “XML Configuration”. The following table describes the attributes of the <repositories /> element:

Table 1. Attributes
Name Description

base-package

Defines the package to be scanned for repository interfaces that extend *Repository (the actual interface is determined by the specific Spring Data module) in auto-detection mode. All packages below the configured package are scanned, too. Wildcards are allowed.

repository-impl-postfix

Defines the postfix to autodetect custom repository implementations. Classes whose names end with the configured postfix are considered as candidates. Defaults to Impl.

query-lookup-strategy

Determines the strategy to be used to create finder queries. See “Query Lookup Strategies” for details. Defaults to create-if-not-found.

named-queries-location

Defines the location to search for a Properties file containing externally defined queries.

consider-nested-repositories

Whether nested repository interface definitions should be considered. Defaults to false.