You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set aes = AccountEntry.findAllByDateGreaterThanEqualAndDateLessThanEqual(c.fromDate, c.toDate)
And I couldn't figure out why it was generating a > and < SQL rather than >= and <= SQL.
So it turned out to be my bad that it should be "Equals" rather than "Equal". However, it's not good that this doesn't generate any error.
So it turns out that in DynamicFinder.java line 643, it tries to use regular expressions to figure out which expression to use. This expression is generated from DynamicFinder.java line 712...
The trouble is, this expression isn't anchored at the end... so it matches GreaterThan and generates no error about the "Equal" which it doesn't understand.
It seems to me that if the expression generated from resetMethodExpressionPattern was changed to end with "$"... the regex end-anchor, it would generate an error about unrecognized "GreaterThanEqual" and lead to more robust code from not having subtle errors that only manifest in certain edge cases.
The text was updated successfully, but these errors were encountered:
I had a dynamic finder like this...
Set aes = AccountEntry.findAllByDateGreaterThanEqualAndDateLessThanEqual(c.fromDate, c.toDate)
And I couldn't figure out why it was generating a > and < SQL rather than >= and <= SQL.
So it turned out to be my bad that it should be "Equals" rather than "Equal". However, it's not good that this doesn't generate any error.
So it turns out that in DynamicFinder.java line 643, it tries to use regular expressions to figure out which expression to use. This expression is generated from DynamicFinder.java line 712...
\p{Upper}[\p{Lower}\d]+(Equal|NotEqual|NotInList|InList|InRange|Between|Like|Ilike|Rlike|GreaterThanEquals|LessThanEquals|GreaterThan|LessThan|IsNull|IsNotNull|IsEmpty|IsNotEmpty)
from...
The trouble is, this expression isn't anchored at the end... so it matches GreaterThan and generates no error about the "Equal" which it doesn't understand.
It seems to me that if the expression generated from resetMethodExpressionPattern was changed to end with "$"... the regex end-anchor, it would generate an error about unrecognized "GreaterThanEqual" and lead to more robust code from not having subtle errors that only manifest in certain edge cases.
The text was updated successfully, but these errors were encountered: