@Override
    public Map<K, V> loadAll(Collection<K> keys) {
        awaitSuccessfulInit();

        Object[] keysArray = keys.toArray();

        String sql = queries.loadAll(keys.size());
        try (SqlResult queryResult = sqlService.execute(sql, keysArray)) {
            Iterator<SqlRow> it = queryResult.iterator();

            Map<K, V> result = new HashMap<>();

            while (it.hasNext()) {
                SqlRow sqlRow = it.next();
                // If there is a single column as the value, return that column as the value
                if (queryResult.getRowMetadata().getColumnCount() == 2 && genericMapStoreProperties.singleColumnAsValue) {
                    K id = sqlRow.getObject(genericMapStoreProperties.idColumn);
                    result.put(id, sqlRow.getObject(1));
                } else {
                    K id = sqlRow.getObject(genericMapStoreProperties.idColumn);
                    //noinspection unchecked
                    V record = (V) toGenericRecord(sqlRow, genericMapStoreProperties);
                    result.put(id, record);
                }
            }
            return result;
        }
    }
@Test
    public void givenRowAndIdColumn_whenLoadAll_thenReturnGenericRecord() {
        ObjectSpec spec = objectProvider.createObject(mapName, true);
        objectProvider.insertItems(spec, 1);

        Properties properties = new Properties();
        properties.setProperty(DATA_CONNECTION_REF_PROPERTY, TEST_DATABASE_REF);
        properties.setProperty(ID_COLUMN_PROPERTY, "person-id");
        mapLoader = createMapLoader(properties, hz);
        GenericRecord genericRecord = mapLoader.loadAll(newArrayList(0)).get(0);

        assertThat(genericRecord.getInt32("person-id")).isZero();
        assertThat(genericRecord.getString("name")).isEqualTo("name-0");
    }