Closed davin111 closed 1 year ago
Hi, @lpandzic. Could you check this PR and give some comments? I fixed tests and added supports for subqueries. Although predicates in having condition and join condition are not supported, I think this PR make building queries with enum fields easy.
Hi, can you add some tests that clearly show the intent?
I'm closing this one as stale. Feel free to reopen when you add tests.
I guess many people define some properties of classes mapped with tables as
enum
.When selecting columns defined as enum, there is no problem because
EntityRowMapper
usingR2dbcConverter
executes simple conversions and user defined conversions (registered viar2dbcCustomConversions()
ofAbstractR2dbcConfiguration
).However, when using the columns with the
where
clause likewhere(user.status.eq(UserStatus.ONLINE)
, problems occur. The generated query not only applyConverter
, but also doesn't enclose the enum value with quotation marks (ex>... where ... user.status = ONLINE
), thus it usually cause db exceptions likeUnknown column 'ONLINE' in 'where clause'
.If this library supports those conversions, it will be very useful.
I don't think my implementation is not the best one, so please give me advice if you have better idea.
And... I want to do similar things for
having
clause, but sadlyQueryMetadata
of QueryDSL doesn't haveclearHaving()
method. So I handled onlywhere
clause, for now.