Skip to content

Add the ORACLE query for doListUsersWithID#4585

Merged
DilshanSenarath merged 1 commit intowso2:4.12.xfrom
DilshanSenarath:oracle-list-user-fix
Apr 22, 2026
Merged

Add the ORACLE query for doListUsersWithID#4585
DilshanSenarath merged 1 commit intowso2:4.12.xfrom
DilshanSenarath:oracle-list-user-fix

Conversation

@DilshanSenarath
Copy link
Copy Markdown

Purpose

In UniqueIDJDBCUserStoreManager, the doListUsersWithID method is invoked when listing users with a username filter and pagination. Although Oracle-specific offset and limit handling has been addressed [1], there is no Oracle-specific query in the default query list. As a result, the fallback queries [2], [3] are used, which include LIMIT and OFFSET clauses that are not supported by Oracle. This PR adds the appropriate Oracle query to resolve this issue.

[1] -

} else if (ORACLE.equalsIgnoreCase(type)) {
limit = offset + limit;
}

[2] -
if (sqlStmt == null) {
sqlStmt = realmConfig.getUserStoreProperty(JDBCRealmConstants.GET_USER_FILTER_PAGINATED_WITH_ID);
}

[3] -
public static final String GET_USER_FILTER_PAGINATED_WITH_ID_SQL = "SELECT UM_USER_ID, UM_USER_NAME FROM UM_USER "
+ "WHERE UM_USER_NAME LIKE ? AND UM_TENANT_ID=? ORDER BY UM_USER_NAME ASC LIMIT ? OFFSET ?";

Related Issue

@DilshanSenarath DilshanSenarath changed the title Add the MSSQL query for doListUsersWithID Add the ORACLE query for doListUsersWithID Apr 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • Enhancements
    • Improved Oracle database support for user filtering with pagination capabilities.

Walkthrough

This PR adds Oracle-specific constants and default SQL implementations for paginated user filter queries with user ID selection across the JDBC realm utilities, including both standard and case-insensitive variants.

Changes

Cohort / File(s) Summary
Oracle Pagination Constants
core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/jdbc/JDBCRealmConstants.java, core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/jdbc/caseinsensitive/JDBCCaseInsensitiveConstants.java
Added Oracle-specific constants for paginated user filter queries with user ID selection. Includes identifier strings and corresponding Oracle SQL templates using rownum-based pagination with case-insensitive name matching variants.
Utility Initialization
core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/util/JDBCRealmUtil.java
Added default SQL property initializations in getSQL method for the new Oracle pagination constants, following existing if (!properties.containsKey(...)) pattern for both standard and case-insensitive branches.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • sadilchamishka
  • wso2-engineering
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description covers Purpose and Related Issue sections comprehensively, explaining the Oracle pagination problem and referencing relevant code. However, most template sections (Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests, Security checks, Samples, Migrations, Test environment, Learning) are missing or incomplete. Complete the missing required sections in the PR description template, particularly Goals, Approach, Automation tests, and Security checks to meet repository standards.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an Oracle-specific query for the doListUsersWithID method to resolve pagination issues.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@wso2-engineering wso2-engineering Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Agent Log Improvement Checklist

⚠️ Warning: AI-Generated Review Comments

  • The log-related comments and suggestions in this review were generated by an AI tool to assist with identifying potential improvements. Purpose of reviewing the code for log improvements is to improve the troubleshooting capabilities of our products.
  • Please make sure to manually review and validate all suggestions before applying any changes. Not every code suggestion would make sense or add value to our purpose. Therefore, you have the freedom to decide which of the suggestions are helpful.

✅ Before merging this pull request:

  • Review all AI-generated comments for accuracy and relevance.
  • Complete and verify the table below. We need your feedback to measure the accuracy of these suggestions and the value they add. If you are rejecting a certain code suggestion, please mention the reason briefly in the suggestion for us to capture it.
Comment Accepted (Y/N) Reason
#### Log Improvement Suggestion No: 1
#### Log Improvement Suggestion No: 2

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/jdbc/JDBCRealmConstants.java`:
- Around line 231-234: The SQL constant
GET_USER_FILTER_PAGINATED_WITH_USER_ID_SQL_ORACLE is correct for Oracle
pagination, but the PR/commit title incorrectly references MSSQL; update the
commit/PR title and description to accurately reflect this Oracle-specific
change (suggested title: "add oracle query for doListUsersWithID") so history
and backports aren’t confused—no code changes needed, just amend the PR/commit
metadata to mention Oracle and doListUsersWithID.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: a75e2bb1-a0ae-4a5f-bb52-4672d67c2565

📥 Commits

Reviewing files that changed from the base of the PR and between 73c6247 and 8497537.

📒 Files selected for processing (3)
  • core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/jdbc/JDBCRealmConstants.java
  • core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/jdbc/caseinsensitive/JDBCCaseInsensitiveConstants.java
  • core/org.wso2.carbon.user.core/src/main/java/org/wso2/carbon/user/core/util/JDBCRealmUtil.java

@jenkins-is-staging
Copy link
Copy Markdown

PR builder started
Link: https://github.com/wso2/product-is/actions/runs/24764115915

@jenkins-is-staging
Copy link
Copy Markdown

PR builder completed
Link: https://github.com/wso2/product-is/actions/runs/24764115915
Status: success

Copy link
Copy Markdown

@jenkins-is-staging jenkins-is-staging left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the pull request based on the successful pr build https://github.com/wso2/product-is/actions/runs/24764115915

@DilshanSenarath DilshanSenarath merged commit f99560a into wso2:4.12.x Apr 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants