Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hel-developer-guide
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Spencer Chang
hel-developer-guide
Commits
619d9fcb
Commit
619d9fcb
authored
Aug 04, 2017
by
11277
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 头行保存.md
parent
869ca623
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
头行保存.md
前端组件/头行保存.md
+19
-12
No files found.
前端组件/头行保存.md
View file @
619d9fcb
...
...
@@ -5,20 +5,27 @@
头行保存在实用中经常用到,头行保存指的是头表和行表(一对多)的数据同时插入,如中途失败则这次事务不进行提交。
假设我们有两张表
<style>
table th:first-of-type {
width: 100px;
}
</style>
**hls_person(头表)**
pid | name | age |
-------- | ----- | -----|
1|张三|21
2|李四|36
*hls_hobby(行表)*
*
hid | pid |hobby| cause|
-------- | -----|----- |-----|
1|1|篮球| 因为篮球好玩
2|1|游泳| 因为游泳好玩
3|1|动画片|最爱看大头儿子
4|2|画画|梵高的画也不过如此
|pid|name|age |
|:---: | :---: | :---:|
|1| 张三 | 21 |
| 2 | 李四| 36 |
*hls_hobby(行表*
*
|hid| pid |hobby| cause|
|:--------: | :-----:|:-----: |:-----:|
|1|1|篮球| 因为篮球好玩|
|2|1|游泳| 因为游泳好玩|
|3|1|动画片|最爱看大头儿子|
|4|2|画画|梵高的画也不过如此|
需求是新增一个人的信息以及它的爱好(向hls_person和hls_hobby表新增记录)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment