Skip to content
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

Feature/composite key #31

Merged
merged 25 commits into from
May 5, 2023
Merged

Feature/composite key #31

merged 25 commits into from
May 5, 2023

Conversation

Akshay-Sundarraj
Copy link
Member

Composite key support
o. Allow NoSqlEntity to have a class as primary key
o. User can specify multiple primary keys in the composite key class
o. User can specify whether a key is shard key and it's order
o. Added new annotation @NoSqlKey for primary key in composite key class

Testing:
Added new unit tests for composite key CRUD operations and spring derive query for composite key. All existing unit tests are passed

o. Allow NoSqlEntity to have a class as primary key
o. User can specify multiple primary keys in the composite key class
o. User can specify whether a key is shard key and it's order
o. Added new entity validation method which extends validation
   supported by Spring data BasicPersistentEntity
p. Added new annotations @NoSqlKey and @NoSqlKeyClass

Signed-off-by: Akshay Sundarraj <akshay.sundarraj@oracle.com>
o. Add javadoc for newly added classes
o. Remove unused code

Signed-off-by: Akshay Sundarraj <akshay.sundarraj@oracle.com>
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Mar 14, 2023
@Akshay-Sundarraj Akshay-Sundarraj marked this pull request as ready for review March 14, 2023 08:45
o. Added a public method getNosqlClient() in NosqlTemplate

All unit tests are passed for both on-prem and cloud
o. Added support for ordering on composite key in Repository
o. Added a new testcase to verify ordering on composite key member
o. Added new set of tests for composite key without @NosqlKey
o. Updated composite key tests to check the result of repo operations
o. Added Pageable and Sort tests
o. Fixed a query issue when composite key is not @NosqlKey
o. Refactor composite key unit test to group by tests
o. Add new unit tests for interface and DTO projection for composite key

All unit tests are passed
… with composite keys

o Add new tests for reactive composite keys
o. Added tests for projecting only primary keys
Copy link
Member

@cezarfx cezarfx left a comment

Choose a reason for hiding this comment

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

Also add an entry in the CHANGELOG.md.

o. Changes order of NosqlKeys in composite key as discussed in meeting
o. Added Javadoc for the same
o. Updated tests for ordering of fields
o. Fixed some of the review comments
Akshay-Sundarraj and others added 6 commits April 21, 2023 17:37
CHANGELOG.md Outdated Show resolved Hide resolved
cezarfx
cezarfx previously approved these changes Apr 26, 2023
Copy link
Member

@cezarfx cezarfx left a comment

Choose a reason for hiding this comment

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

Looks good, please merge into main branch as a single commit and make sure the checkin comment explains the entire change.

… non shard keys.

o. Updated the javadoc for the same
o. Updated the tests

if (!nonShardMap.isEmpty()) {
int shardMaxOrder =
(int) ((TreeMap<?, ?>) shardMap).lastKey();
Copy link
Member

Choose a reason for hiding this comment

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

To avoid the up castings I would declare the shardMap and nonShardMap as TreeMap.

@Akshay-Sundarraj Akshay-Sundarraj merged commit 0c308ed into main May 5, 2023
@Akshay-Sundarraj Akshay-Sundarraj deleted the feature/composite-key branch May 12, 2023 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants