Skip to content

Add criteria API to create filter predicates #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mp911de opened this issue Feb 20, 2019 · 0 comments
Closed

Add criteria API to create filter predicates #64

mp911de opened this issue Feb 20, 2019 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@mp911de
Copy link
Member

mp911de commented Feb 20, 2019

To make DatabaseClient's select() API more usable, we should introduce a Criteria API for row filtering. Right now, select statements build through DatabaseClient.select() are unfiltered and thus not usable for the majority of ad-hoc queries.

Having a Criteria API allows us to lay a foundation for update and delete DSL support.

@mp911de mp911de added the type: enhancement A general enhancement label Feb 20, 2019
@mp911de mp911de self-assigned this Mar 25, 2019
@mp911de mp911de added this to the 1.0 M2 milestone Mar 25, 2019
mp911de added a commit that referenced this issue Apr 30, 2019
mp911de added a commit that referenced this issue Apr 30, 2019
We now support Criteria creation and mapping to express where conditions with a fluent API.

databaseClient.select().from("legoset")
				.where(Criteria.of("name").like("John%").and("id").lessThanOrEquals(42055));
mp911de added a commit that referenced this issue Apr 30, 2019
Move PreparedOperation to operation package.
mp911de added a commit that referenced this issue Apr 30, 2019
We now support DELETE queries using DatabaseClient's delete() DSL.

databaseClient.delete()
				.from(LegoSet.class)
				.where(Criteria.of("id").is(42055))
				.then()

databaseClient.delete()
				.from(LegoSet.class)
				.where(Criteria.of("id").is(42055))
				.fetch()
				.rowsUpdated()
mp911de added a commit that referenced this issue Apr 30, 2019
In place until we migrate to Spring Data Relational dialects.
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
We now support Criteria creation and mapping to express where conditions with a fluent API.

databaseClient.select().from("legoset")
				.where(Criteria.of("name").like("John%").and("id").lessThanOrEquals(42055));
mp911de added a commit that referenced this issue May 2, 2019
Move PreparedOperation to operation package.
mp911de added a commit that referenced this issue May 2, 2019
We now support DELETE queries using DatabaseClient's delete() DSL.

databaseClient.delete()
				.from(LegoSet.class)
				.where(Criteria.of("id").is(42055))
				.then()

databaseClient.delete()
				.from(LegoSet.class)
				.where(Criteria.of("id").is(42055))
				.fetch()
				.rowsUpdated()
mp911de added a commit that referenced this issue May 2, 2019
In place until we migrate to Spring Data Relational dialects.
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 2, 2019
mp911de added a commit that referenced this issue May 6, 2019
mp911de added a commit that referenced this issue May 6, 2019
We now support Criteria creation and mapping to express where conditions with a fluent API.

databaseClient.select().from("legoset")
				.where(Criteria.of("name").like("John%").and("id").lessThanOrEquals(42055));

databaseClient.delete()
				.from(LegoSet.class)
				.where(Criteria.of("id").is(42055))
				.then()

databaseClient.delete()
				.from(LegoSet.class)
				.where(Criteria.of("id").is(42055))
				.fetch()
				.rowsUpdated()
mp911de added a commit that referenced this issue May 6, 2019
Document fluent API. Add fluent API for update. Introduce StatementMapper. Migrate Insert to StatementMapper. Refactoring and cleanup. Migrate Select to StatementMapper.
schauder added a commit that referenced this issue May 7, 2019
Fixed typos, formatting and minor errors in documentation.
odrotbohm added a commit that referenced this issue May 8, 2019
Incorporated feedback from review. Polished documentation and Javadoc. Minor code improvements restructuring for better readability. Removed unused methods types. Some polishing for compiler warnings.

Original pull request: #106.
odrotbohm pushed a commit that referenced this issue May 8, 2019
We now support Criteria creation and mapping to express where conditions with a fluent API.

databaseClient.select().from("legoset")
  .where(Criteria.of("name").like("John%").and("id").lessThanOrEquals(42055));

databaseClient.delete()
  .from(LegoSet.class)
  .where(Criteria.of("id").is(42055))
  .then()

databaseClient.delete()
  .from(LegoSet.class)
  .where(Criteria.of("id").is(42055))
  .fetch()
  .rowsUpdated()

Original pull request: #106.
odrotbohm pushed a commit that referenced this issue May 8, 2019
odrotbohm pushed a commit that referenced this issue May 8, 2019
Document fluent API. Add fluent API for update. Introduce StatementMapper. Migrate Insert to StatementMapper. Refactoring and cleanup. Migrate Select to StatementMapper.

Original pull request: #106.
odrotbohm pushed a commit that referenced this issue May 8, 2019
Fixed typos, formatting and minor errors in documentation.

Original pull request: #106.
odrotbohm added a commit that referenced this issue May 8, 2019
Incorporated feedback from review. Polished documentation and Javadoc. Minor code improvements restructuring for better readability. Removed unused methods types. Some polishing for compiler warnings.

Original pull request: #106.
@odrotbohm odrotbohm assigned odrotbohm and unassigned odrotbohm May 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants