本文整理汇总了Java中com.datastax.driver.mapping.Mapper.Option方法的典型用法代码示例。如果您正苦于以下问题:Java Mapper.Option方法的具体用法?Java Mapper.Option怎么用?Java Mapper.Option使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.datastax.driver.mapping.Mapper
的用法示例。
在下文中一共展示了Mapper.Option方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import com.datastax.driver.mapping.Mapper; //导入方法依赖的package包/类
@Override
public void open(Configuration configuration) {
super.open(configuration);
try {
this.mappingManager = new MappingManager(session);
this.mapper = mappingManager.mapper(clazz);
if (options != null) {
Mapper.Option[] optionsArray = options.getMapperOptions();
if (optionsArray != null) {
this.mapper.setDefaultSaveOptions(optionsArray);
}
}
} catch (Exception e) {
throw new RuntimeException("Cannot create CassandraPojoSink with input: " + clazz.getSimpleName(), e);
}
}
示例2: getMapperOptions
import com.datastax.driver.mapping.Mapper; //导入方法依赖的package包/类
/**
* Returns an array of {@link com.datastax.driver.mapping.Mapper.Option} that are used configure the mapper.
*
* @return array of options used to configure the mapper.
*/
Mapper.Option[] getMapperOptions();
示例3: delete
import com.datastax.driver.mapping.Mapper; //导入方法依赖的package包/类
/**
* Delete an entity by ID.
*
* @param entityClass Entity class.
* @param id entity ID.
* @param options Options.
*/
public void delete(final Class<?> entityClass, final Object id, final Mapper.Option... options) {
Mapper mapper = mapper(entityClass);
mapper.delete(id, options);
}
示例4: deleteAsync
import com.datastax.driver.mapping.Mapper; //导入方法依赖的package包/类
/**
* Delete an entity by ID.
*
* @param entityClass Entity class.
* @param id Entity id.
* @param options Options.
* @return An empty listenable future.
*/
public ListenableFuture<Void> deleteAsync(final Class<?> entityClass, final Object id,
final Mapper.Option... options) {
Mapper mapper = mapper(entityClass);
return mapper.deleteAsync(id, options);
}
示例5: save
import com.datastax.driver.mapping.Mapper; //导入方法依赖的package包/类
/**
* Save an entity.
*
* @param entity Entity to save.
* @param options Options.
*/
public <T> void save(final T entity, final Mapper.Option... options) {
Class entityClass = entity.getClass();
Mapper mapper = mapper(entityClass);
mapper.save(entity, options);
}
示例6: saveAsync
import com.datastax.driver.mapping.Mapper; //导入方法依赖的package包/类
/**
* Save an entity.
*
* @param entity Entity to save.
* @param options Options.
* @return An empty listenable future.
*/
public <T> ListenableFuture<Void> saveAsync(final T entity, final Mapper.Option... options) {
Class entityClass = entity.getClass();
Mapper mapper = mapper(entityClass);
return mapper.saveAsync(entity, options);
}