List of usage examples for org.springframework.data.cassandra.core CassandraOperations selectOne
@Nullable
<T> T selectOne(Query query, Class<T> entityClass) throws DataAccessException;
From source file:edu.elka.peakadvisor.model.CassandraDao.java
public Latest readOneWithCurrName(int timestamp, String name) { CassandraOperations template = this.cassandraTemplate; Latest result = template.selectOne("SELECT timestamp,base,disclaimer,license,rates." + name + " " + "FROM latest WHERE timestamp=" + timestamp + ";", Latest.class); //tak wiem ze to ma podatnosc, ale jest problem z cudzyslowami przy normalnym chainowaniu //chainuje "rates.btc" zamiast rates.btc, nie potrafie tego naprawic return result; }
From source file:edu.elka.peakadvisor.model.CassandraDao.java
public Latest readOne(int timestamp) { CassandraOperations template = this.cassandraTemplate; Select selectStatement = QueryBuilder.select().from("Latest").allowFiltering(); selectStatement.where(QueryBuilder.eq("timestamp", timestamp)); Latest result = template.selectOne(selectStatement, Latest.class); return result; }