public String getTableName(Class> entityClass) {
return determineTableName(entityClass);
}
<<<<<<< HEAD
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insert(java.util.List)
*/
@Override
public List insert(List entities) {
String tableName = getTableName(entities.get(0).getClass());
Assert.notNull(tableName);
return insert(entities, tableName);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insert(java.util.List, java.lang.String)
*/
@Override
public List insert(List entities, String tableName) {
return insert(entities, tableName, new HashMap());
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insert(java.util.List, java.lang.String, java.util.Map)
*/
@Override
public List insert(List entities, String tableName, Map optionsByName) {
Assert.notNull(entities);
Assert.notEmpty(entities);
Assert.notNull(tableName);
Assert.notNull(optionsByName);
return doBatchInsert(tableName, entities, optionsByName, false);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insert(java.util.List, java.lang.String, org.springframework.data.cassandra.core.QueryOptions)
*/
@Override
public List insert(List entities, String tableName, QueryOptions options) {
return insert(entities, tableName, options.toMap());
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insert(java.lang.Object)
*/
@Override
public T insert(T entity) {
String tableName = determineTableName(entity);
Assert.notNull(tableName);
return insert(entity, tableName);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insert(java.lang.Object, java.lang.String)
*/
@Override
public T insert(T entity, String tableName) {
return insert(entity, tableName, new HashMap());
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insert(java.lang.Object, java.lang.String, java.util.Map)
*/
@Override
public T insert(T entity, String tableName, Map optionsByName) {
Assert.notNull(entity);
Assert.notNull(tableName);
ensureNotIterable(entity);
return doInsert(tableName, entity, optionsByName, false);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insert(java.lang.Object, java.lang.String, org.springframework.data.cassandra.core.QueryOptions)
*/
@Override
public T insert(T entity, String tableName, QueryOptions options) {
return insert(entity, tableName, options.toMap());
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insertAsynchronously(java.util.List)
*/
@Override
public List insertAsynchronously(List entities) {
String tableName = getTableName(entities.get(0).getClass());
Assert.notNull(tableName);
return insertAsynchronously(entities, tableName);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insertAsynchronously(java.util.List, java.lang.String)
*/
@Override
public List insertAsynchronously(List entities, String tableName) {
return insertAsynchronously(entities, tableName, new HashMap());
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insertAsynchronously(java.util.List, java.lang.String, java.util.Map)
*/
@Override
public List insertAsynchronously(List entities, String tableName, Map optionsByName) {
Assert.notNull(entities);
Assert.notEmpty(entities);
Assert.notNull(tableName);
Assert.notNull(optionsByName);
return doBatchInsert(tableName, entities, optionsByName, true);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insertAsynchronously(java.util.List, java.lang.String, org.springframework.data.cassandra.core.QueryOptions)
*/
@Override
public List insertAsynchronously(List entities, String tableName, QueryOptions options) {
return insertAsynchronously(entities, tableName, options.toMap());
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insertAsynchronously(java.lang.Object)
*/
@Override
public T insertAsynchronously(T entity) {
String tableName = determineTableName(entity);
Assert.notNull(tableName);
return insertAsynchronously(entity, tableName);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insertAsynchronously(java.lang.Object, java.lang.String)
*/
@Override
public T insertAsynchronously(T entity, String tableName) {
return insertAsynchronously(entity, tableName, new HashMap());
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insertAsynchronously(java.lang.Object, java.lang.String, java.util.Map)
*/
@Override
public T insertAsynchronously(T entity, String tableName, Map optionsByName) {
Assert.notNull(entity);
Assert.notNull(tableName);
Assert.notNull(optionsByName);
ensureNotIterable(entity);
return doInsert(tableName, entity, optionsByName, true);
}
/* (non-Javadoc)
* @see org.springframework.data.cassandra.core.CassandraOperations#insertAsynchronously(java.lang.Object, java.lang.String, org.springframework.data.cassandra.core.QueryOptions)
*/
@Override
public T insertAsynchronously(T entity, String tableName, QueryOptions options) {
return insertAsynchronously(entity, tableName, options.toMap());
=======
public ResultSet executeQuery(String query) {
try {
return session.execute(query);
} catch (RuntimeException e) {
throw potentiallyConvertRuntimeException(e);
}
>>>>>>> be3ff7819358e4bb1caa3db09e87bd0d433ff52d
}
/* (non-Javadoc) |