Coder Social home page Coder Social logo

Comments (3)

qinkangdeid avatar qinkangdeid commented on June 19, 2024

debug代码跟踪能够查看到:当扫描扫实体类当中的 关联属性的时候装载LogicalDeletedInfo在判断type的类型的时候就会出错 源码在LogicalDeletedInfo代码第219行判断了逻辑删除字段的类型

尝试修改源码验证:

方式一:

在 org.babyfish.jimmer.meta.LogicalDeletedInfo#parseValue方法中 Class<?> type = prop.getElementClass(); 语句前 添加:
c64c401b88f1132000073f196b89fafc
本意是想跳过 关联属性 的类型判断

运行 启动成功
执行删除api的时候 删除中间表的时候经过JoinTableFilter(代码第29行)获取不到LogicalDeletedInfo的值(因为是null)报空指针错误
93452799676acd6a9a52076f5b65fbdc

方式二

修改parseValue方法 增加一个参数returnType
方法内部不使用prop参数判断类型 使用上面逻辑的returnType来判断类型
20fb3b5ae72017acf5ff543264ec73bd

运行测试:
启动正常:
能解析出正确的字段和逻辑删除值
但是运行测试的时候必须要配置一个 initializedValue 的值 不配置的话 会在代码379行处报错:

1cb21347bcbd099115e462b76e019513

根据提示修改 添加 initializedValue
35d95731510b4eebd08c845d90d17651

最终运行 达到预期:
4062a8a5d5f9f7fe61a96a12b3688acf

对jimmer源码不熟悉 这是我的debug与自认为的修改过程 给大佬一个参考

from jimmer.

babyfish-ct avatar babyfish-ct commented on June 19, 2024

Try 0.8.99

from jimmer.

qinkangdeid avatar qinkangdeid commented on June 19, 2024

Try 0.8.99

fixed

from jimmer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.