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

The following examples show how to use org.springframework.data.cassandra.repository.Query. 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 File: ProductMetadataRepo.java    From yugastore-java with 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 File: ProductRankingRepository.java    From yugastore-java with 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 File: ProductRankingRepository.java    From yugastore-java with 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 File: HeatMapDataRepository.java    From lambda-arch with 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 File: WindowTrafficDataRepository.java    From lambda-arch with 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 File: TotalTrafficDataRepository.java    From lambda-arch with 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
Source File: WindowTrafficDataRepository.java    From iot-traffic-monitor with 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 #8
Source File: TotalTrafficDataRepository.java    From iot-traffic-monitor with 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 #9
Source File: BookRepository.java    From tutorials with 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 File: BasicUserRepository.java    From spring-data-examples with 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 File: PersonRepository.java    From spring-data-examples with 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 File: OrderRepository.java    From spring-data-examples with 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
Source File: RxJava2PersonRepository.java    From spring-data-examples with Apache License 2.0 2 votes vote down vote up
/**
 * 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
Source File: ReactivePersonRepository.java    From spring-data-examples with Apache License 2.0 2 votes vote down vote up
/**
 * 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);