Add capability to search policies by device type #339

Merged
pahansith merged 1 commits from ashvini/device-mgt-core:Improvement#10585 into master 2 months ago
There is no content yet.
ashvini added 1 commit 7 months ago
ashvini changed title from WIP: Add capability to search policies by device type to Add capability to search policies by device type 7 months ago
tcdlpds requested changes 4 months ago
package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy;
import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.*;
Owner

Do not use wild card imports.

Do not use wild card imports.
ashvini force-pushed Improvement#10585 from d2301d54dd to 6e1f9d9655 3 months ago
rajitha requested changes 3 months ago
return policies;
}
protected List<Policy> extractPolicyListWithProfileFromDbResult(ResultSet resultSet, int tenantId) throws SQLException {
Collaborator

Add java doc comments

Add java doc comments
protected List<Policy> extractPolicyListWithProfileFromDbResult(ResultSet resultSet, int tenantId) throws SQLException {
List<Policy> policies = new ArrayList<>();
while (resultSet.next()) {
Policy policy = new Policy();
Collaborator

Move the declaration logic out side the loop

Move the declaration logic out side the loop
List<Policy> policies = new ArrayList<>();
while (resultSet.next()) {
Policy policy = new Policy();
policy.setId(resultSet.getInt("ID"));
Collaborator

Better to move the populating logic into a separate method

Better to move the populating logic into a separate method
policy.setPolicyType(resultSet.getString("POLICY_TYPE"));
policy.setPolicyPayloadVersion(resultSet.getString("PAYLOAD_VERSION"));
Profile profile = new Profile();
Collaborator

Move the declaration logic out side the loop

Move the declaration logic out side the loop
isDeviceTypeProvided = true;
}
query += "ORDER BY P.ID LIMIT ?,?";
Collaborator

Is limit keyword exists in oracle sql syntax? Check if this part is syntactically correct with Oracle SQL.

Is limit keyword exists in oracle sql syntax? Check if this part is syntactically correct with Oracle SQL.
isDeviceTypeProvided = true;
}
query += "ORDER BY P.ID LIMIT ?,?";
Collaborator

For PostgreSQL it is necessary to specify the LIMIT and OFFSET

For PostgreSQL it is necessary to specify the `LIMIT` and `OFFSET`
isDeviceTypeProvided = true;
}
query += "ORDER BY P.ID LIMIT ?,?";
Collaborator

Check this syntax correct with MSSQL syntax

Check this syntax correct with MSSQL syntax
ashvini force-pushed Improvement#10585 from 6e1f9d9655 to c760b20f1c 2 months ago
ashvini force-pushed Improvement#10585 from c760b20f1c to 8a82d1666c 2 months ago
pahansith merged commit 290952ae53 into master 2 months ago

Reviewers

tcdlpds requested changes 4 months ago
rajitha requested changes 3 months ago
The pull request has been merged as 290952ae53.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: community/device-mgt-core#339
Loading…
There is no content yet.