public synchronized void register(Class<?> clazz, TableSchema schema) {
        String schemaKey;
        if (schema.getTableName() != null && schema.getQuery() == null) {
            schemaKey = schema.getTableName();
        } else if (schema.getQuery() != null && schema.getTableName() == null) {
            schemaKey = schema.getQuery();
        } else {
            throw new IllegalArgumentException("Table schema has both query and table name set. Only one is allowed.");
        }
        tableSchemaCache.put(schemaKey, schema);
        tableSchemaHasDefaults.put(schemaKey, schema.hasDefaults());

        pojoSerDe.registerClass(clazz, schema);
    }
<p>Registers a POJO class and maps its fields to a table schema</p>
<p>Note: table schema will be stored in cache to be used while other operations. Cache key is
 {@link TableSchema schemaId}. Call this method
to update cache.</p>

@param clazz - class of a POJO
@param schema - correlating table schema
client-v2/src/main/java/com/clickhouse/client/api/Client.java