|
|
|
@ -2796,43 +2796,46 @@ public class GenericOperationDAOImpl implements OperationDAO {
|
|
|
|
|
"WHERE o.ID = ? " +
|
|
|
|
|
"AND o.TENANT_ID = ?";
|
|
|
|
|
|
|
|
|
|
try (Connection conn = OperationManagementDAOFactory.getConnection();
|
|
|
|
|
PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
|
stmt.setInt(1, operationId);
|
|
|
|
|
stmt.setInt(2, tenantId);
|
|
|
|
|
try {
|
|
|
|
|
Connection conn = OperationManagementDAOFactory.getConnection();
|
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
|
stmt.setInt(1, operationId);
|
|
|
|
|
stmt.setInt(2, tenantId);
|
|
|
|
|
|
|
|
|
|
try (ResultSet rs = stmt.executeQuery()) {
|
|
|
|
|
List<OperationResponseDTO> responses = new ArrayList<>();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
if (operationDetails.getOperationId() == 0) {
|
|
|
|
|
operationDetails.setOperationId(rs.getInt("ID"));
|
|
|
|
|
operationDetails.setOperationCode(rs.getString("OPERATION_CODE"));
|
|
|
|
|
Blob detailsBlob = rs.getBlob("OPERATION_DETAILS");
|
|
|
|
|
if (detailsBlob != null) {
|
|
|
|
|
JSONObject operationDetailsJson = OperationDAOUtil.convertBlobToJsonObject(detailsBlob);
|
|
|
|
|
operationDetails.setOperationDetails(operationDetailsJson);
|
|
|
|
|
}
|
|
|
|
|
Blob propertiesBlob = rs.getBlob("OPERATION_PROPERTIES");
|
|
|
|
|
if (propertiesBlob != null) {
|
|
|
|
|
JSONObject operationPropertiesJson = OperationDAOUtil.convertBlobToJsonObject(propertiesBlob);
|
|
|
|
|
operationDetails.setOperationProperties(operationPropertiesJson);
|
|
|
|
|
try (ResultSet rs = stmt.executeQuery()) {
|
|
|
|
|
List<OperationResponseDTO> responses = new ArrayList<>();
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
if (operationDetails.getOperationId() == 0) {
|
|
|
|
|
operationDetails.setOperationId(rs.getInt("ID"));
|
|
|
|
|
operationDetails.setOperationCode(rs.getString("OPERATION_CODE"));
|
|
|
|
|
Blob detailsBlob = rs.getBlob("OPERATION_DETAILS");
|
|
|
|
|
if (detailsBlob != null) {
|
|
|
|
|
JSONObject operationDetailsJson = OperationDAOUtil.convertBlobToJsonObject(detailsBlob);
|
|
|
|
|
operationDetails.setOperationDetails(operationDetailsJson);
|
|
|
|
|
}
|
|
|
|
|
Blob propertiesBlob = rs.getBlob("OPERATION_PROPERTIES");
|
|
|
|
|
if (propertiesBlob != null) {
|
|
|
|
|
JSONObject operationPropertiesJson = OperationDAOUtil.convertBlobToJsonObject(propertiesBlob);
|
|
|
|
|
operationDetails.setOperationProperties(operationPropertiesJson);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String response = rs.getString("OPERATION_RESPONSE");
|
|
|
|
|
Timestamp responseTimestamp = rs.getTimestamp("RECEIVED_TIMESTAMP");
|
|
|
|
|
if (response != null && responseTimestamp != null) {
|
|
|
|
|
OperationResponseDTO operationResponse = new OperationResponseDTO();
|
|
|
|
|
operationResponse.setOperationResponse(response);
|
|
|
|
|
operationResponse.setResponseTimeStamp(responseTimestamp);
|
|
|
|
|
responses.add(operationResponse);
|
|
|
|
|
String response = rs.getString("OPERATION_RESPONSE");
|
|
|
|
|
Timestamp responseTimestamp = rs.getTimestamp("RECEIVED_TIMESTAMP");
|
|
|
|
|
if (response != null && responseTimestamp != null) {
|
|
|
|
|
OperationResponseDTO operationResponse = new OperationResponseDTO();
|
|
|
|
|
operationResponse.setOperationResponse(response);
|
|
|
|
|
operationResponse.setResponseTimeStamp(responseTimestamp);
|
|
|
|
|
responses.add(operationResponse);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
operationDetails.setOperationResponses(responses);
|
|
|
|
|
}
|
|
|
|
|
operationDetails.setOperationResponses(responses);
|
|
|
|
|
}
|
|
|
|
|
} catch (SQLException e) {
|
|
|
|
|
throw new OperationManagementDAOException("Error occurred while retrieving operation details for operation ID: "
|
|
|
|
|
+ operationId, e);
|
|
|
|
|
String msg = "Error occurred while retrieving operation details for operation ID: " + operationId;
|
|
|
|
|
log.error(msg, e);
|
|
|
|
|
throw new OperationManagementDAOException(msg, e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return operationDetails;
|
|
|
|
|