babyfish-ct / jimmer

A revolutionary ORM framework for both java and kotlin.
Apache License 2.0
882 stars 91 forks source link

经过确认,子对象迁移的防御确实存在问题 #775

Closed sunshio closed 2 weeks ago

sunshio commented 2 weeks ago

版本0.9.12

image

image 仍然执行成功

sunshio commented 2 weeks ago

这是我单独抽取的工程,没有加过多配置

spring: datasource: url: jdbc:mysql://localhost:3306/jimmer?allowMultiQueries=true&rewriteBatchedStatements=true username: root password: jimmer: show-sql: true database-validation: mode: error catalog: jimmer

sunshio commented 2 weeks ago

org.babyfish.jimmer.sql.ast.impl.mutation.Operator#isChanged

image

sunshio commented 2 weeks ago

image 这循环里的return是不是有点问题?

babyfish-ct commented 2 weeks ago

可能是DraftInterceptor内部逻辑的问题,是不是对BookProps.STORE进行了unload,让其无法比较,你先去掉DraftInterceptor试试

babyfish-ct commented 2 weeks ago

0.9.15对此问题进行了主动防御,有助于调查

sunshio commented 2 weeks ago

实测发现:去除BaseEntityDraftInterceptor,但手动设置createdTime和modifiedTime仍出现此问题,设置price还是出现此问题,似乎只有key only时能防御

以下是去除BaseEntityDraftInterceptor后的情况 image 这个不行

image 这个可以

sunshio commented 2 weeks ago

image

babyfish-ct commented 2 weeks ago

OK, 知道原因了。下班后处理

babyfish-ct commented 2 weeks ago

Try 0.9.16