1.取消自定义id,让id自增
Showing
2 changed files
with
3 additions
and
2 deletions
| ... | @@ -24,6 +24,7 @@ import java.io.Serializable; | ... | @@ -24,6 +24,7 @@ import java.io.Serializable; |
| 24 | public class GrowthReport implements Serializable { | 24 | public class GrowthReport implements Serializable { |
| 25 | 25 | ||
| 26 | @Id | 26 | @Id |
| 27 | @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| 27 | @Column(name = "id") | 28 | @Column(name = "id") |
| 28 | private Long id; | 29 | private Long id; |
| 29 | 30 | ... | ... |
| ... | @@ -41,8 +41,8 @@ public class GrowthReportServiceImpl implements GrowthReportService { | ... | @@ -41,8 +41,8 @@ public class GrowthReportServiceImpl implements GrowthReportService { |
| 41 | @Override | 41 | @Override |
| 42 | @Transactional(rollbackFor = Exception.class) | 42 | @Transactional(rollbackFor = Exception.class) |
| 43 | public void create(GrowthReport resources) { | 43 | public void create(GrowthReport resources) { |
| 44 | Snowflake snowflake = IdUtil.createSnowflake(1, 1); | 44 | /* Snowflake snowflake = IdUtil.createSnowflake(1, 1); |
| 45 | resources.setId(snowflake.nextId()); | 45 | resources.setId(snowflake.nextId());*/ |
| 46 | this.growthReportRepository.save(resources); | 46 | this.growthReportRepository.save(resources); |
| 47 | } | 47 | } |
| 48 | 48 | ... | ... |
-
Please register or sign in to post a comment