@Override PrepareRequest deserialize(Message genericMsg) { final Requests.PrepareRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.PrepareRequest.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 field unless the new field is provided long totalRowsForStatement = msg.getMaxRowCount(); if (msg.hasField(MAX_ROWS_TOTAL_DESCRIPTOR)) { totalRowsForStatement = msg.getMaxRowsTotal(); } return new PrepareRequest(connectionId, sql, totalRowsForStatement); }
@Override PrepareRequest deserialize(Message genericMsg) { final Requests.PrepareRequest msg = ProtobufService.castProtobufMessage(genericMsg, Requests.PrepareRequest.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 field unless the new field is provided long totalRowsForStatement = msg.getMaxRowCount(); if (msg.hasField(MAX_ROWS_TOTAL_DESCRIPTOR)) { totalRowsForStatement = msg.getMaxRowsTotal(); } return new PrepareRequest(connectionId, sql, totalRowsForStatement); }