支持Graalvm的ORM框架-Gaarason
https://github.com/gaarason/database-all
注意事项
- 声明
model
是使用@Component
而非@Repository
- 依赖注入是使用
@Autowired
而非@Resource
- 所有自定的
Autoconfiguration
需要手动执行init()
- 所有
model
和entity
需要反射, 即通过@TypeHint
声明 @Column
中有使用到的 自定义class, 都需要反射, 即通过@TypeHint
声明- 所有
model
不能实现其他的自定义接口 lambda风格字段
不可使用- 所有
model
需要 container.getBean(ModelShadowProvider.class).loadModels() , 目前做了动态加载, 建议model
定义为entity
的内部类
应该还有其他的不兼容的地方, 以后补充
@NativeHint( types = @TypeHint(types = { // entity // ... GeneralModel.class, GeneralModel.Table.class }), jdkProxies = @JdkProxyHint(types = { // interface // ... Model.class, SoftDelete.class, Query.class, SpringProxy.class, Advised.class, DecoratingProxy.class }), aotProxies = { // model // ... @AotProxyHint(targetClass = GeneralModel.class) } ) @SpringBootApplication(proxyBeanMethods = false) public class GraalVmCompatibilityApplication { public static void main(String[] args) throws InterruptedException { try { SpringApplication.run(GraalVmCompatibilityApplication.class, args); } catch (Throwable throwable) { System.out.println("something is error."); System.out.println(throwable.getMessage()); System.out.println(Arrays.toString(throwable.getStackTrace())); } new CountDownLatch(1).await(); } }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律