mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fix certificate search by partial device identifiers
This commit is contained in:
parent
bea478d0ca
commit
aa6c9f6734
@ -67,7 +67,7 @@ public class GenericCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
sql += " AND DEVICE_IDENTIFIER = ?";
|
||||
sql += " AND DEVICE_IDENTIFIER LIKE ?";
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(username)) {
|
||||
@ -83,7 +83,7 @@ public class GenericCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
stmt.setString(paramIdx++, deviceIdentifier);
|
||||
stmt.setString(paramIdx++, "%" + deviceIdentifier + "%");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(username)) {
|
||||
@ -129,7 +129,7 @@ public class GenericCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
query += "AND DEVICE_IDENTIFIER = ? ";
|
||||
query += "AND DEVICE_IDENTIFIER LIKE ? ";
|
||||
isCertificateDeviceIdentifierProvided = true;
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ public class GenericCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
stmt.setString(paramIdx++, "%" + serialNumber + "%");
|
||||
}
|
||||
if (isCertificateDeviceIdentifierProvided) {
|
||||
stmt.setString(paramIdx++, deviceIdentifier);
|
||||
stmt.setString(paramIdx++, "%" + deviceIdentifier + "%");
|
||||
}
|
||||
if (isCertificateUsernameProvided) {
|
||||
stmt.setString(paramIdx++, "%" + username + "%");
|
||||
|
||||
@ -68,7 +68,7 @@ public class OracleCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
query += "AND DEVICE_IDENTIFIER = ? ";
|
||||
query += "AND DEVICE_IDENTIFIER LIKE ? ";
|
||||
isCertificateDeviceIdentifierProvided = true;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class OracleCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
stmt.setString(paramIdx++, "%" + serialNumber + "%");
|
||||
}
|
||||
if (isCertificateDeviceIdentifierProvided) {
|
||||
stmt.setString(paramIdx++, deviceIdentifier);
|
||||
stmt.setString(paramIdx++, "%" + deviceIdentifier + "%");
|
||||
}
|
||||
if (isCertificateUsernameProvided) {
|
||||
stmt.setString(paramIdx++, "%" + username + "%");
|
||||
@ -140,7 +140,7 @@ public class OracleCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
sql += " AND DEVICE_IDENTIFIER = ?";
|
||||
sql += " AND DEVICE_IDENTIFIER LIKE ?";
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(username)) {
|
||||
@ -156,7 +156,7 @@ public class OracleCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
stmt.setString(paramIdx++, deviceIdentifier);
|
||||
stmt.setString(paramIdx++, "%" + deviceIdentifier + "%");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(username)) {
|
||||
|
||||
@ -68,7 +68,7 @@ public class PostgreSQLCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
query += "AND DEVICE_IDENTIFIER = ? ";
|
||||
query += "AND DEVICE_IDENTIFIER LIKE ? ";
|
||||
isCertificateDeviceIdentifierProvided = true;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class PostgreSQLCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
stmt.setString(paramIdx++, "%" + serialNumber + "%");
|
||||
}
|
||||
if (isCertificateDeviceIdentifierProvided) {
|
||||
stmt.setString(paramIdx++, deviceIdentifier);
|
||||
stmt.setString(paramIdx++, "%" + deviceIdentifier + "%");
|
||||
}
|
||||
if (isCertificateUsernameProvided) {
|
||||
stmt.setString(paramIdx++, "%" + username + "%");
|
||||
@ -140,7 +140,7 @@ public class PostgreSQLCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
sql += " AND DEVICE_IDENTIFIER = ?";
|
||||
sql += " AND DEVICE_IDENTIFIER LIKE ?";
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(username)) {
|
||||
@ -156,7 +156,7 @@ public class PostgreSQLCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
stmt.setString(paramIdx++, deviceIdentifier);
|
||||
stmt.setString(paramIdx++, "%" + deviceIdentifier + "%");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(username)) {
|
||||
|
||||
@ -68,7 +68,7 @@ public class SQLServerCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
query += "AND DEVICE_IDENTIFIER = ? ";
|
||||
query += "AND DEVICE_IDENTIFIER LIKE ? ";
|
||||
isCertificateDeviceIdentifierProvided = true;
|
||||
}
|
||||
|
||||
@ -86,7 +86,7 @@ public class SQLServerCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
stmt.setString(paramIdx++, "%" + serialNumber + "%");
|
||||
}
|
||||
if (isCertificateDeviceIdentifierProvided) {
|
||||
stmt.setString(paramIdx++, deviceIdentifier);
|
||||
stmt.setString(paramIdx++, "%" + deviceIdentifier + "%");
|
||||
}
|
||||
if (isCertificateUsernameProvided) {
|
||||
stmt.setString(paramIdx++, "%" + username + "%");
|
||||
@ -140,7 +140,7 @@ public class SQLServerCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
sql += " AND DEVICE_IDENTIFIER = ?";
|
||||
sql += " AND DEVICE_IDENTIFIER LIKE ?";
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(username)) {
|
||||
@ -156,7 +156,7 @@ public class SQLServerCertificateDAOImpl extends AbstractCertificateDAOImpl {
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(deviceIdentifier)) {
|
||||
stmt.setString(paramIdx++, deviceIdentifier);
|
||||
stmt.setString(paramIdx++, "%" + deviceIdentifier + "%");
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(username)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user