diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2018-03-20 02:08:47 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-20 02:08:47 +0000 |
commit | 2699e2ca4dc9289bb677888c76b048f5d8001587 (patch) | |
tree | 2d81f5df17b1f7ed80cfe557c678c133f83d8518 /adapters | |
parent | 7d36778ec5438cb9bf8fa7450186548b8846358e (diff) | |
parent | 5e6179609805dfab1b571d58517cef6d3a169f77 (diff) |
Merge "Fix String concatenation optimzation"
Diffstat (limited to 'adapters')
-rw-r--r-- | adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java index 358fe53ecb..925086a9d3 100644 --- a/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java +++ b/adapters/mso-requests-db-adapter/src/main/java/org/openecomp/mso/adapters/requestsdb/MsoRequestsDbAdapterImpl.java @@ -70,59 +70,59 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter { long startTime = System.currentTimeMillis (); try { session.beginTransaction (); - String queryString = "update InfraActiveRequests set "; + StringBuilder queryString = new StringBuilder("update InfraActiveRequests set "); if (statusMessage != null) { - queryString += "statusMessage = :statusMessage, "; + queryString.append("statusMessage = :statusMessage, "); } if (responseBody != null) { - queryString += "responseBody = :responseBody, "; + queryString.append("responseBody = :responseBody, "); } if (requestStatus != null) { - queryString += "requestStatus = :requestStatus, "; + queryString.append("requestStatus = :requestStatus, "); } if (progress != null) { - queryString += "progress = :progress, "; + queryString.append("progress = :progress, "); } if (vnfOutputs != null) { - queryString += "vnfOutputs = :vnfOutputs, "; + queryString.append("vnfOutputs = :vnfOutputs, "); } if (serviceInstanceId != null) { - queryString += "serviceInstanceId = :serviceInstanceId, "; + queryString.append("serviceInstanceId = :serviceInstanceId, "); } if (networkId != null) { - queryString += "networkId = :networkId, "; + queryString.append("networkId = :networkId, "); } if (vnfId != null) { - queryString += "vnfId = :vnfId, "; + queryString.append("vnfId = :vnfId, "); } if (vfModuleId != null) { - queryString += "vfModuleId = :vfModuleId, "; + queryString.append("vfModuleId = :vfModuleId, "); } if (volumeGroupId != null) { - queryString += "volumeGroupId = :volumeGroupId, "; + queryString.append("volumeGroupId = :volumeGroupId, "); } if (serviceInstanceName != null) { - queryString += "serviceInstanceName = :serviceInstanceName, "; + queryString.append("serviceInstanceName = :serviceInstanceName, "); } if (vfModuleName != null) { - queryString += "vfModuleName = :vfModuleName, "; + queryString.append("vfModuleName = :vfModuleName, "); } if (configurationId != null) { - queryString += "configurationId = :configurationId, "; + queryString.append("configurationId = :configurationId, "); } if (configurationName != null) { - queryString += "configurationName = :configurationName, "; + queryString.append("configurationName = :configurationName, "); } if (requestStatus == RequestStatusType.COMPLETE || requestStatus == RequestStatusType.FAILED) { - queryString += "endTime = :endTime, "; + queryString.append("endTime = :endTime, "); } else { - queryString += "modifyTime = :modifyTime, "; + queryString.append("modifyTime = :modifyTime, "); } - queryString += "lastModifiedBy = :lastModifiedBy where requestId = :requestId OR clientRequestId = :requestId"; + queryString.append("lastModifiedBy = :lastModifiedBy where requestId = :requestId OR clientRequestId = :requestId"); - logger.debug("Executing update: " + queryString); + logger.debug("Executing update: " + queryString.toString()); - Query query = session.createQuery (queryString); + Query query = session.createQuery (queryString.toString()); query.setParameter ("requestId", requestId); if (statusMessage != null) { query.setParameter ("statusMessage", statusMessage); |