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

Added KapuaQuery.defaultSortCriteria #3287

Merged
merged 4 commits into from
Apr 19, 2021

Conversation

Coduz
Copy link
Contributor

@Coduz Coduz commented Mar 29, 2021

This PR adds an API method which enforces the implementation of the queries to define a default sorting which will be used if kapuaQuery.sortCriteria is not defined.
Not this is achieved by the definition on the AbstractKapuaQuery constructor and can happen that if someone does not uses the default constructor with super() the sorting is not set.

Related Issue
None

Description of the solution adopted
Added getDefaultSortCriteria to KapuaQuery API and a default implementation which defaults to sorting KapuaEntity.id.
Added also a new extendsion of AbstractKapuaQuery for KapuaNamedEntityes to default the sorting of the KapuaNamedEntities to name which is the most common sorting for those entities (i.e. User, Account, ...).
Added indexes on scopeId, name fields on Account, User and Job table to improve performances when searching and sorting by name from the console.

Screenshots
None

Any side note on the changes made
FIxed javadoc for classes

@Coduz Coduz added the Enhancement This PR/Issue improves an part of Kapua label Mar 29, 2021
@Coduz Coduz requested a review from lorthirk March 29, 2021 15:05
@codecov
Copy link

codecov bot commented Mar 29, 2021

Codecov Report

Merging #3287 (5f7043c) into develop (58f80bf) will decrease coverage by 25.25%.
The diff coverage is 41.66%.

❗ Current head 5f7043c differs from pull request most recent head 4222e96. Consider uploading reports for the commit 4222e96 to get more accurate results
Impacted file tree graph

@@              Coverage Diff               @@
##             develop    #3287       +/-   ##
==============================================
- Coverage      53.23%   27.97%   -25.26%     
+ Complexity       788      252      -536     
==============================================
  Files           1475     1476        +1     
  Lines          30151    30162       +11     
  Branches        2520     2520               
==============================================
- Hits           16050     8437     -7613     
- Misses         13203    21022     +7819     
+ Partials         898      703      -195     
Impacted Files Coverage Δ Complexity Δ
.../commons/configuration/ServiceConfigQueryImpl.java 100.00% <ø> (ø) 0.00 <0.00> (ø)
...vice/event/store/internal/EventStoreQueryImpl.java 0.00% <ø> (-100.00%) 0.00 <0.00> (ø)
...gine/queue/jbatch/QueuedJobExecutionQueryImpl.java 0.00% <ø> (-100.00%) 0.00 <0.00> (-1.00)
...pua/service/account/internal/AccountQueryImpl.java 100.00% <ø> (ø) 0.00 <0.00> (ø)
...nternal/JobDeviceManagementOperationQueryImpl.java 0.00% <ø> (-100.00%) 0.00 <0.00> (-1.00)
...n/internal/DeviceManagementOperationQueryImpl.java 0.00% <0.00%> (-100.00%) 0.00 <0.00> (ø)
...rnal/ManagementOperationNotificationQueryImpl.java 0.00% <0.00%> (-100.00%) 0.00 <0.00> (ø)
...tion/internal/DeviceConnectionOptionQueryImpl.java 100.00% <ø> (ø) 0.00 <0.00> (ø)
.../registry/event/internal/DeviceEventQueryImpl.java 0.00% <0.00%> (-100.00%) 0.00 <0.00> (ø)
...rvice/endpoint/internal/EndpointInfoQueryImpl.java 0.00% <ø> (-100.00%) 0.00 <0.00> (ø)
... and 640 more

@Coduz Coduz force-pushed the feature-kapuaQueryDefaultSorting branch from 64909ba to 6e22489 Compare April 6, 2021 09:45
@Coduz Coduz force-pushed the feature-kapuaQueryDefaultSorting branch from 6e22489 to 8e56ce8 Compare April 16, 2021 09:30
Coduz added 4 commits April 19, 2021 11:05
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
…NTITY_ID

Signed-off-by: Alberto Codutti <alberto.codutti@eurotech.com>
@Coduz Coduz force-pushed the feature-kapuaQueryDefaultSorting branch from 8e56ce8 to 4222e96 Compare April 19, 2021 09:05
@Coduz Coduz merged commit f9a15d3 into eclipse-kapua:develop Apr 19, 2021
@Coduz Coduz deleted the feature-kapuaQueryDefaultSorting branch July 6, 2021 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This PR/Issue improves an part of Kapua
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant