@Override PrepareAndExecuteRequest deserialize(Message genericMsg) { final Requests.PrepareAndExecuteRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.PrepareAndExecuteRequest.class); String connectionId = null; if (msg.hasField(CONNECTION_ID_DESCRIPTOR)) { connectionId = msg.getConnectionId(); } String sql = null; if (msg.hasField(SQL_DESCRIPTOR)) { sql = msg.getSql(); } // Use the old attribute, unless the new is set long maxRowsTotal = msg.getMaxRowCount(); if (msg.hasField(MAX_ROWS_TOTAL_DESCRIPTOR)) { maxRowsTotal = msg.getMaxRowsTotal(); } // Use maxRowCount (cast to an integer) if firstFrameMaxSize isn't set int maxRowsInFirstFrame = (int) maxRowsTotal; if (msg.hasField(FIRST_FRAME_MAX_SIZE_DESCRIPTOR)) { maxRowsInFirstFrame = msg.getFirstFrameMaxSize(); } return new PrepareAndExecuteRequest(connectionId, msg.getStatementId(), sql, maxRowsTotal, maxRowsInFirstFrame); }
@Override PrepareAndExecuteRequest deserialize(Message genericMsg) { final Requests.PrepareAndExecuteRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.PrepareAndExecuteRequest.class); String connectionId = null; if (msg.hasField(CONNECTION_ID_DESCRIPTOR)) { connectionId = msg.getConnectionId(); } String sql = null; if (msg.hasField(SQL_DESCRIPTOR)) { sql = msg.getSql(); } // Use the old attribute, unless the new is set long maxRowsTotal = msg.getMaxRowCount(); if (msg.hasField(MAX_ROWS_TOTAL_DESCRIPTOR)) { maxRowsTotal = msg.getMaxRowsTotal(); } // Use maxRowCount (cast to an integer) if firstFrameMaxSize isn't set int maxRowsInFirstFrame = (int) maxRowsTotal; if (msg.hasField(FIRST_FRAME_MAX_SIZE_DESCRIPTOR)) { maxRowsInFirstFrame = msg.getFirstFrameMaxSize(); } return new PrepareAndExecuteRequest(connectionId, msg.getStatementId(), sql, maxRowsTotal, maxRowsInFirstFrame); }