Java Code Examples for org.springframework.data.cassandra.repository.Query

The following examples show how to use org.springframework.data.cassandra.repository.Query. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: yugastore-java   Source File: ProductMetadataRepo.java    License: Apache License 2.0 4 votes vote down vote up
@Query("SELECT * FROM cronos.products limit ?0 offset ?1")
@RestResource(path = "products", rel = "products")
public List<ProductMetadata> getProducts(@Param("limit") int limit, @Param("offset") int offset);
 
Example 2
Source Project: yugastore-java   Source File: ProductRankingRepository.java    License: Apache License 2.0 4 votes vote down vote up
@Query("select * from cronos.product_rankings where asin=?0")
@RestResource(path = "product", rel = "product")
Optional<ProductRanking> findProductRankingById(String asin);
 
Example 3
Source Project: yugastore-java   Source File: ProductRankingRepository.java    License: Apache License 2.0 4 votes vote down vote up
@Query("SELECT * FROM cronos.product_rankings where category =?0 limit ?1 offset ?2")
@RestResource(path = "category", rel = "category")
public List<ProductRanking> getProductsByCategory(@Param("name") String category, @Param("limit") int limit, @Param("offset") int offset);
 
Example 4
Source Project: lambda-arch   Source File: HeatMapDataRepository.java    License: Apache License 2.0 4 votes vote down vote up
@Query("SELECT * FROM traffickeyspace.heat_map WHERE timestamp = ?0 ALLOW FILTERING")
Iterable<TotalTrafficData> findHeatMapByDate(Date date);
 
Example 5
Source Project: lambda-arch   Source File: WindowTrafficDataRepository.java    License: Apache License 2.0 4 votes vote down vote up
@Query("SELECT * FROM traffickeyspace.window_traffic WHERE recorddate = ?0 ALLOW FILTERING")
Iterable<WindowTrafficData> findTrafficDataByDate(String date);
 
Example 6
Source Project: lambda-arch   Source File: TotalTrafficDataRepository.java    License: Apache License 2.0 4 votes vote down vote up
@Query("SELECT * FROM traffickeyspace.total_traffic WHERE recorddate = ?0 ALLOW FILTERING")
Iterable<TotalTrafficData> findTrafficDataByDate(String date);
 
Example 7
@Query("SELECT * FROM traffickeyspace.window_traffic WHERE recorddate = ?0 ALLOW FILTERING")
Iterable<WindowTrafficData> findTrafficDataByDate(String date);
 
Example 8
@Query("SELECT * FROM traffickeyspace.total_traffic WHERE recorddate = ?0 ALLOW FILTERING")
Iterable<TotalTrafficData> findTrafficDataByDate(String date);
 
Example 9
Source Project: tutorials   Source File: BookRepository.java    License: MIT License 4 votes vote down vote up
@Query("select * from book where title = ?0 and publisher=?1")
Iterable<Book> findByTitleAndPublisher(String title, String publisher);
 
Example 10
Source Project: spring-data-examples   Source File: BasicUserRepository.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Sample method annotated with {@link Query}. This method executes the CQL from the {@link Query} value.
 *
 * @param id
 * @return
 */
@Query("SELECT * from users where user_id in(?0)")
User findUserByIdIn(long id);
 
Example 11
Source Project: spring-data-examples   Source File: PersonRepository.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Sample method to derive a query from using JDK 8's {@link Optional} as return type.
 *
 * @param id
 * @return
 */
@Query("select * from person where id = ?0")
Optional<Person> findPersonById(String id);
 
Example 12
Source Project: spring-data-examples   Source File: OrderRepository.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Method parameters are converted according the registered Converters into Cassandra types.
 */
@Query("SELECT * from pizza_orders WHERE orderdate = ?0 and zoneid = ?1 ALLOW FILTERING")
Order findOrderByOrderDateAndZoneId(LocalDate orderDate, ZoneId zoneId);
 
Example 13
/**
 * String query selecting one entity.
 *
 * @param lastname
 * @return
 */
@Query("SELECT * FROM person WHERE firstname = ?0 and lastname  = ?1")
Single<Person> findByFirstnameAndLastname(String firstname, String lastname);
 
Example 14
/**
 * String query selecting one entity.
 *
 * @param lastname
 * @return
 */
@Query("SELECT * FROM person WHERE firstname = ?0 and lastname  = ?1")
Mono<Person> findByFirstnameInAndLastname(String firstname, String lastname);