-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add missing office where clause in Clob getAll query #937
base: develop
Are you sure you want to change the base?
Conversation
Since we (probably me) got this wrong at least once there should probably be tests that go along with these changes. |
.join(v_office).on(v_clob.OFFICE_CODE.eq(v_office.OFFICE_CODE)) | ||
.where(JooqDao.caseInsensitiveLikeRegex(v_clob.ID,idRegex)) | ||
.and(DSL.upper(v_clob.ID).greaterThan(clobCursor)) | ||
.and(officeLike == null ? noCondition() : DSL.upper(v_office.OFFICE_ID).like(officeLike.toUpperCase())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be caseInsensitiveRegexLike -right?
Paging should also order by office and clobId.
Probably need test
Is there an approved issue for these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issue, I'll create one, good call on the regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added tests, made office id support regex, ordered the page by office id and clob id.
public Clobs getClobs(String cursor, int pageSize, String officeLike, | ||
boolean includeValues, String idRegex) { | ||
int total = 0; | ||
String clobCursor = "*"; | ||
AV_CLOB v_clob = AV_CLOB.AV_CLOB; | ||
AV_OFFICE v_office = AV_OFFICE.AV_OFFICE; | ||
|
||
Condition whereClause = JooqDao.caseInsensitiveLikeRegex(v_clob.ID, idRegex) | ||
.and(officeLike == null ? noCondition() : JooqDao.caseInsensitiveLikeRegex(v_office.OFFICE_ID, officeLike)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't you add a caseInsensitiveLikeRegexNullTrue that does exactly this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, I have no recollection of writing that, but I guess I did!
.from(v_clob) | ||
.join(v_office).on(v_clob.OFFICE_CODE.eq(v_office.OFFICE_CODE)) | ||
.where(whereClause) | ||
.and(DSL.upper(v_clob.ID).greaterThan(clobCursor)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still isn't quite right. At least in my opinion. If you are ordering by office and clobId then I think the paging has to do the sameOffice/nextOffice thing. See buildPagingCondition in TimeSeriesDaoImpl for what I'm talking about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fairly certain Ryan is correct. especially if you have more than one office possibly coming through, but even just limiting to a single you want that sorting to be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, thanks for catching this. Updated to match how you handled it in the projects endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there another commit? I don't see it in these changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the paging cursor needs to deal with the office and clobId of the cursor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paging conditions still don't look right. From your two part cursor you want to find items in the same office that have later clobIds AND you also want things that are in latter offices. Are you doing that and I'm not seeing it?
No description provided.