blinkfox / fenix

This is an extension library to the Spring Data JPA complex or dynamic SQL query. 这是一个比 MyBatis 更加强大的 Spring Data JPA 扩展库,为解决复杂动态 JPQL (或 SQL) 而生。https://blinkfox.github.io/fenix
https://blinkfox.github.io/fenix
Apache License 2.0
345 stars 72 forks source link

FenixPredicateBuilder 是否考虑支持Lamda表达式获取字段名 #42

Open threefish opened 3 years ago

threefish commented 3 years ago

例如:

List<Blog> blogs = blogRepository.findAll(builder ->
                builder.andIn(Blog::getId, ids, ids != null && ids.length > 0)
                        .andLike(Blog::getTitle, params.get("title"), params.get("title") != null)
                        .andLike(Blog::getAuthor, params.get("author"))
                        .andBetween(Blog::getCreateTime, params.get("startTime"), params.get("endTime"))
                .build());
blinkfox commented 3 years ago

@threefish 暂不支持哈,在考虑到底是否有必要添加。

threefish commented 3 years ago

好的,我先用着,有机会的话我来个pr吧

blinkfox commented 3 years ago

要加的话,很多重载方法都得加 Supplier 的函数式接口

hexian commented 3 years ago

好的,我先用着,有机会的话我来个pr吧

这个我看了下mybatis plus的代码,找时间我提个pr吧,会不会抢活了,哈哈哈。

threefish commented 3 years ago

好的,我先用着,有机会的话我来个pr吧

这个我看了下mybatis plus的代码,找时间我提个pr吧,会不会抢活了,哈哈哈。

期待,哈哈

hexian commented 3 years ago

好的,我先用着,有机会的话我来个pr吧

这个我看了下mybatis plus的代码,找时间我提个pr吧,会不会抢活了,哈哈哈。

期待,哈哈

好的,明天我先在fork分支上写完,等前面一个功能合并了,我再提个pr。

hexian commented 3 years ago

好的,我先用着,有机会的话我来个pr吧

这个我看了下mybatis plus的代码,找时间我提个pr吧,会不会抢活了,哈哈哈。

期待,哈哈

我提交代码了,等待作者合并代码 https://github.com/blinkfox/fenix/pull/47/commits/8544bf6e3241fa0c58b1e596dc78971f24186264

bearmr commented 2 years ago

@threefish 暂不支持哈,在考虑到底是否有必要添加。

强烈建议加上

203579397 commented 2 years ago

可以抄抄MybatisPlus。加上JPA的多对多功能,mybatis就没啥市场了

bearmr commented 2 years ago

主要是我是mybatis-plus 用的习惯了,但是这个公司是用jpa,我之前没搞过jpa,直接下重手仿照有点不太敢

203579397 commented 2 years ago

我也是用MP用的多,但这几年用下来,尤其是微服务开发,还是觉着JPA的 @ManyTOMany 很方便,然后就发现了Fenix。所以就希望Fenix 抄一下 MP

pengten commented 2 years ago

这个不是已经合并了吗?咋还在讨论,有新问题建立新的issue吧

bearmr commented 2 years ago

这个不是已经合并了吗?咋还在讨论,有新问题建立新的issue吧

没有说如何使用哈

bearmr commented 2 years ago

这个不是已经合并了吗?咋还在讨论,有新问题建立新的issue吧 这边2.6.1没有看到有相关代码合并发版

blinkfox commented 2 years ago

我在新版本中也没看到,不知道是不是有次清理某些与之前版本不兼容的代码时给清掉了。

后续版本我再看看,或者大家有时间可以再提交下。代码、注释和单元测试写好点儿,否则我通常不会合并。