Skip to content

Commit

Permalink
Merge pull request #67 from Fs-DXMY/patch-4
Browse files Browse the repository at this point in the history
修改部分文档错误
  • Loading branch information
babyfish-ct authored Nov 17, 2024
2 parents e0c9c78 + df2806b commit 3c72564
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/mapping/advanced/view/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ View properties and original properties share the same underlying data, the only
In this article, you will learn about these annotations:

- org.babyfish.jimmer.sql.IdView
- org.babyfish.jimmer.sql.ManyToView
- org.babyfish.jimmer.sql.ManyToManyView
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ title: 视图属性
在这里,你会了解到这些注解

- org.babyfish.jimmer.sql.IdView
- org.babyfish.jimmer.sql.ManyToView
- org.babyfish.jimmer.sql.ManyToManyView
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ for ((name, website) in books) { ❷
1. 由于`BookStore.website`是可空的,❶处select的第二列的类型为`String?`而非`String`
最终,查询返回的数据的类型为`List<Tuple2<String, String?>>`

2.处通过循环遍历查询查询到的每一个元祖,将其解构成变量`name``website`
2.处通过循环遍历查询查询到的每一个元组,将其解构成变量`name``website`
由于`tuples`的类型为`List<Tuple2<String, String?>>`,这里`website`的类型是`String?`

3. ❸处对可能为null的`website`进行`.length`运算,导致编译错误。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ data class BookDTO(
</TabItem>
</Tabs>

再把元祖转化为`BookDTO`对象,有两种办法
再把元组转化为`BookDTO`对象,有两种办法

- 不修改之前的代码,先查询出`Tuple3<Long, String, Integer>`集合,再用Stream API转换

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ where tb_2_.BOOK_ID in (

:::tip
无论是本文讨论的简单查询,还是下一篇文档要讨论的[复杂查询](./default)
只要查询返回实体对象或其集合,而非简单的列元祖
只要查询返回实体对象或其集合,而非简单的列元组
都建议添加一个`Fetcher`参数,让所有对象查询具备如同`GraphQL`一样的强大数据结构形状控制能力。

这会为上层业务开发带来巨大的便利。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,7 @@ where tb_2_.BOOK_ID in (

:::tip
无论是本文讨论的复杂查询,还是上一篇文档讨论过的[简单查询](./abstract)
只要查询返回实体对象或其集合,而非简单的列元祖
只要查询返回实体对象或其集合,而非简单的列元组
都建议添加一个`Fetcher`参数,让所有对象查询具备如同`GraphQL`一样的强大数据结构形状控制能力。

这会为上层业务开发带来巨大的便利。
Expand Down

0 comments on commit 3c72564

Please sign in to comment.