/** * Return the {@link MappingContext} instance to map Entities to properties. * * @throws ClassNotFoundException if the Cassandra Entity class type identified by name cannot be found during the * scan. * @see CassandraMappingContext */ @Bean public CassandraMappingContext cassandraMapping() throws ClassNotFoundException { Cluster cluster = getRequiredCluster(); CassandraMappingContext mappingContext = new CassandraMappingContext( new SimpleUserTypeResolver(cluster, getKeyspaceName()), new SimpleTupleTypeFactory(cluster)); Optional.ofNullable(this.beanClassLoader).ifPresent(mappingContext::setBeanClassLoader); mappingContext.setInitialEntitySet(getInitialEntitySet()); CustomConversions customConversions = customConversions(); mappingContext.setCustomConversions(customConversions); mappingContext.setSimpleTypeHolder(customConversions.getSimpleTypeHolder()); return mappingContext; }