List<CassandraColumnInfo> columns=mapper.mapClassToColumnList(key.getEntityClass());
if (!columns.isEmpty()) {
for (CassandraColumnInfo column:columns) {
ColumnQuery query=HFactory.createColumnQuery(keyspace, StringSerializer.get(), StringSerializer.get(), column.getSerializer());
QueryResult result=query.setColumnFamily(key.getEntityClass().getName().replace(".", "_")).setKey(key.getId()).setName(column.getColumnName()).execute();
if (result!=null) {
if (entity==null) {
entity=key.getEntityClass().newInstance();
}
Object value=result.get();
column.setValue(entity, value);
}
}
} else {
// this is a entity with no setters, so we don't can set any attributes, the implementation retuns a empty object just containing the id