-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DATACASS-7 - Support query derivation in Cassandra repositories.
We now support query derivation in Cassandra repositories. Repositories may declare query methods and queries are created based on the repository declaration. interface PersonRepository extends CassandraRepository<Person> { List<Person> findByLastname(@CassandraType(type = Name.VARCHAR) String lastname); List<Person> findByLastname(String lastname, Sort sort); List<Person> findByLastnameOrderByFirstnameAsc(String lastname); Collection<PersonProjection> findPersonProjectedBy(); interface PersonProjection { String getFirstname(); } } @table @DaTa public class Person { @PrimaryKeyColumn(type = PrimaryKeyType.PARTITIONED, ordinal = 0) private String lastname; @PrimaryKeyColumn(type = PrimaryKeyType.CLUSTERED, ordinal = 1) private String firstname; } Query derivation supports a basic set of where predicates: * = (Equals/Simple property) * >= (Greater or equal) * > (Greater) * < (Less) * <= (Less or equal) * IN, LIKE (Like, Starting with, Ending with), CONTAINING * = true (Is true) * = false (Is false) Derived queries work with primary-key and non-primary key columns. Non-primary key columns require a secondary index otherwise these fields can't be queried. Original pull request: #74.
- Loading branch information
Showing
33 changed files
with
2,180 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.