Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改部分文档错误 #67

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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