Search in sources :

Example 1 with BuiltStatement

use of com.datastax.driver.core.querybuilder.BuiltStatement in project cassandra-driver-mapping by valchkou.

the class MappingSession method delete.

/**
     * Delete Entity
     * 
     * @param entity
     */
public <E> void delete(E entity) {
    maybeSync(entity.getClass());
    BuiltStatement bs = MappingBuilder.buildDelete(entity, keyspace);
    execute(bs);
}
Also used : BuiltStatement(com.datastax.driver.core.querybuilder.BuiltStatement)

Example 2 with BuiltStatement

use of com.datastax.driver.core.querybuilder.BuiltStatement in project cassandra-driver-mapping by valchkou.

the class MappingSession method deleteAsync.

/**
     * Asynchronously Delete Entity
     * 
     * @param entity
     * @return ResultSetFuture
     */
public <E> ResultSetFuture deleteAsync(E entity) {
    maybeSync(entity.getClass());
    BuiltStatement bs = MappingBuilder.buildDelete(entity, keyspace);
    return executeAsync(bs);
}
Also used : BuiltStatement(com.datastax.driver.core.querybuilder.BuiltStatement)

Example 3 with BuiltStatement

use of com.datastax.driver.core.querybuilder.BuiltStatement in project cassandra-driver-mapping by valchkou.

the class MappingSession method delete.

/**
     * Delete Entity by ID(Primary key)
     * 
     * @param class Entity.class
     * @param id Primary Key
     */
public <T> void delete(Class<T> clazz, Object id) {
    maybeSync(clazz);
    BuiltStatement bs = MappingBuilder.buildDelete(clazz, id, keyspace);
    execute(bs);
}
Also used : BuiltStatement(com.datastax.driver.core.querybuilder.BuiltStatement)

Example 4 with BuiltStatement

use of com.datastax.driver.core.querybuilder.BuiltStatement in project cassandra-driver-mapping by valchkou.

the class MappingSession method deleteAsync.

/**
     * Asynchronously Delete Entity by ID(Primary key)
     * 
     * @param class Entity.class
     * @param id Primary Key
     */
public <T> ResultSetFuture deleteAsync(Class<T> clazz, Object id) {
    maybeSync(clazz);
    BuiltStatement bs = MappingBuilder.buildDelete(clazz, id, keyspace);
    return executeAsync(bs);
}
Also used : BuiltStatement(com.datastax.driver.core.querybuilder.BuiltStatement)

Aggregations

BuiltStatement (com.datastax.driver.core.querybuilder.BuiltStatement)4