-
Notifications
You must be signed in to change notification settings - Fork 11
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
Conversation
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>
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
src/main/java/com/oracle/nosql/spring/data/core/NosqlTemplateBase.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/NosqlTemplateBase.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/NosqlTemplateBase.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/mapping/NosqlKey.java
Outdated
Show resolved
Hide resolved
src/test/java/com/oracle/nosql/spring/data/test/composite/TestTableCreation.java
Outdated
Show resolved
Hide resolved
src/test/java/com/oracle/nosql/spring/data/test/composite/TestTableCreation.java
Outdated
Show resolved
Hide resolved
o. Added tests for projecting only primary keys
src/main/java/com/oracle/nosql/spring/data/core/convert/MappingNosqlConverter.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/convert/MappingNosqlConverter.java
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/convert/MappingNosqlConverter.java
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/query/CriteriaQuery.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/repository/support/NosqlEntityInformation.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/repository/support/NosqlEntityInformation.java
Show resolved
Hide resolved
src/test/java/com/oracle/nosql/spring/data/test/composite/Machine.java
Outdated
Show resolved
Hide resolved
src/test/java/com/oracle/nosql/spring/data/test/composite/MachineApp.java
Show resolved
Hide resolved
src/test/java/com/oracle/nosql/spring/data/test/composite/MachineRepository.java
Show resolved
Hide resolved
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.
Also add an entry in the CHANGELOG.md.
src/main/java/com/oracle/nosql/spring/data/core/mapping/BasicNosqlPersistentProperty.java
Show resolved
Hide resolved
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
src/main/java/com/oracle/nosql/spring/data/repository/support/NosqlEntityInformation.java
Show resolved
Hide resolved
src/test/java/com/oracle/nosql/spring/data/test/composite/MachineApp.java
Show resolved
Hide resolved
src/test/java/com/oracle/nosql/spring/data/test/composite/MachineApp.java
Show resolved
Hide resolved
src/test/java/com/oracle/nosql/spring/data/test/composite/MachineApp.java
Show resolved
Hide resolved
src/test/java/com/oracle/nosql/spring/data/test/composite/MachineApp.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/NosqlTemplateBase.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/NosqlTemplateBase.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/NosqlTemplateBase.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/NosqlTemplateBase.java
Outdated
Show resolved
Hide resolved
src/main/java/com/oracle/nosql/spring/data/core/mapping/BasicNosqlPersistentProperty.java
Outdated
Show resolved
Hide resolved
o. Move composite key validation to NosqlEntityInformation
o. Updated check for field collision
o. Updated CHANGELOG.md o. Added new test for kv_json_ as composite key
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.
Looks good, please merge into main branch as a single commit and make sure the checkin comment explains the entire change.
o. Update a unit test
…ql-spring-sdk into feature/composite-key
… non shard keys. o. Updated the javadoc for the same o. Updated the tests
|
||
if (!nonShardMap.isEmpty()) { | ||
int shardMaxOrder = | ||
(int) ((TreeMap<?, ?>) shardMap).lastKey(); |
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.
To avoid the up castings I would declare the shardMap and nonShardMap as TreeMap.
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