All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sfm.datastax.impl.DatastaxMappingContextFactoryBuilder Maven / Gradle / Ivy

There is a newer version: 8.2.3
Show newest version
package org.sfm.datastax.impl;

import com.datastax.driver.core.GettableByIndexData;
import org.sfm.datastax.DatastaxColumnKey;
import org.sfm.map.context.KeySourceGetter;
import org.sfm.map.context.MappingContextFactoryBuilder;

public class DatastaxMappingContextFactoryBuilder extends MappingContextFactoryBuilder {
    public DatastaxMappingContextFactoryBuilder() {
        super(new JdbcKeySourceGetter());
    }

    private static class JdbcKeySourceGetter implements KeySourceGetter {
        @Override
        public Object getValue(DatastaxColumnKey key, GettableByIndexData source)  {
            return source.getObject(key.getIndex());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy