Ignite Spring Data @Query 注释是否支持投影的概念来检索字段的子集而不是整个对象?

Does Ignite Spring Data @Query annotation support concept of projections to retrieve a subset of fields instead of entire object?

我想知道 Apache Ignite Spring 数据实现是否支持 projections 的概念,以便于仅检索 fields/attributes 缓存实体的一个子集,而不是获取整个实体可能有很多列。

在文档中,我看到了一个示例,其中仅提取缓存实体的一个属性,如下所示。

 /**
 * Getting ids of all the Person satisfying the custom query from {@link Query} annotation.
 *
 * @param orgId Query parameter.
 * @param pageable Pageable interface.
 * @return A list of Persons' ids.
 */
@Query("SELECT id FROM Person WHERE orgId > ?")
public List<Long> selectId(long orgId, Pageable pageable);

以上面的例子为例,如果需要 "id" & "firstName","lastName" "Person" 实体而不只是 "id" 同上?

谢谢

更新(Post @alamar 的回答): 谢谢@alamar!我还从 Spring 数据测试代码中复制了方法声明及其使用代码,以便其他人可以轻松地遵循答案。

/** */
@Query("SELECT _key, secondName FROM Person WHERE firstName REGEXP ?")
public List<List> selectSeveralField(String val, Pageable pageable);

/** */
public void testSelectSeveralFields() {
    List<List> lists = repo.selectSeveralField("^[a-z]+$", new PageRequest(2, 6));

    assertEquals(6, lists.size());

    for (List list : lists) {
        assertEquals(2, list.size());

        assertTrue(list.get(0) instanceof Integer);
    }
}

然而,拥有 Spring 数据投影类型机制可以消除用户代码中麻烦的强制转换会更好。

来自Spring数据测试:

@Query("SELECT _key, secondName FROM Person WHERE firstName REGEXP ?")
public List<List> selectSeveralField(String val, Pageable pageable);

例如是的,您可以列出多个字段并获取这些字段的列表(元组)列表。