Skip to content

Commit

Permalink
#215 - Polishing.
Browse files Browse the repository at this point in the history
Formatting.

Original pull request: #397.
  • Loading branch information
schauder committed Jul 22, 2020
1 parent 4140981 commit b605daa
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public ReactiveDelete delete(Class<?> domainType) {

Assert.notNull(domainType, "DomainType must not be null");

return new ReactiveDeleteSupport(this.template, domainType, Query.empty(), null);
return new ReactiveDeleteSupport(template, domainType, Query.empty(), null);
}

static class ReactiveDeleteSupport implements ReactiveDelete, TerminatingDelete {
Expand Down Expand Up @@ -73,7 +73,7 @@ public DeleteWithQuery from(SqlIdentifier tableName) {

Assert.notNull(tableName, "Table name must not be null");

return new ReactiveDeleteSupport(this.template, this.domainType, this.query, tableName);
return new ReactiveDeleteSupport(template, domainType, query, tableName);
}

/*
Expand All @@ -85,19 +85,19 @@ public TerminatingDelete matching(Query query) {

Assert.notNull(query, "Query must not be null");

return new ReactiveDeleteSupport(this.template, this.domainType, query, this.tableName);
return new ReactiveDeleteSupport(template, domainType, query, tableName);
}

/*
* (non-Javadoc)
* @see org.springframework.data.r2dbc.core.ReactiveDeleteOperation.TerminatingDelete#all()
*/
public Mono<Integer> all() {
return this.template.doDelete(this.query, this.domainType, getTableName());
return template.doDelete(query, domainType, getTableName());
}

private SqlIdentifier getTableName() {
return this.tableName != null ? this.tableName : this.template.getTableName(this.domainType);
return tableName != null ? tableName : template.getTableName(domainType);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public <T> ReactiveInsert<T> insert(Class<T> domainType) {

Assert.notNull(domainType, "DomainType must not be null");

return new ReactiveInsertSupport<>(this.template, domainType, null);
return new ReactiveInsertSupport<>(template, domainType, null);
}

static class ReactiveInsertSupport<T> implements ReactiveInsert<T> {
Expand All @@ -69,7 +69,7 @@ public TerminatingInsert<T> into(SqlIdentifier tableName) {

Assert.notNull(tableName, "Table name must not be null");

return new ReactiveInsertSupport<>(this.template, this.domainType, tableName);
return new ReactiveInsertSupport<>(template, domainType, tableName);
}

/*
Expand All @@ -81,11 +81,11 @@ public Mono<T> using(T object) {

Assert.notNull(object, "Object to insert must not be null");

return this.template.doInsert(object, getTableName());
return template.doInsert(object, getTableName());
}

private SqlIdentifier getTableName() {
return this.tableName != null ? this.tableName : this.template.getTableName(this.domainType);
return tableName != null ? tableName : template.getTableName(domainType);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public SelectWithProjection<T> from(SqlIdentifier tableName) {

Assert.notNull(tableName, "Table name must not be null");

return new ReactiveSelectSupport<>(this.template, this.domainType, this.returnType, this.query, tableName);
return new ReactiveSelectSupport<>(template, domainType, returnType, query, tableName);
}

/*
Expand All @@ -88,7 +88,7 @@ public <R> SelectWithQuery<R> as(Class<R> returnType) {

Assert.notNull(returnType, "ReturnType must not be null");

return new ReactiveSelectSupport<>(this.template, this.domainType, returnType, this.query, this.tableName);
return new ReactiveSelectSupport<>(template, domainType, returnType, query, tableName);
}

/*
Expand All @@ -100,7 +100,7 @@ public TerminatingSelect<T> matching(Query query) {

Assert.notNull(query, "Query must not be null");

return new ReactiveSelectSupport<>(this.template, this.domainType, this.returnType, query, this.tableName);
return new ReactiveSelectSupport<>(template, domainType, returnType, query, tableName);
}

/*
Expand All @@ -109,7 +109,7 @@ public TerminatingSelect<T> matching(Query query) {
*/
@Override
public Mono<Long> count() {
return this.template.doCount(this.query, this.domainType, getTableName());
return template.doCount(query, domainType, getTableName());
}

/*
Expand All @@ -118,7 +118,7 @@ public Mono<Long> count() {
*/
@Override
public Mono<Boolean> exists() {
return this.template.doExists(this.query, this.domainType, getTableName());
return template.doExists(query, domainType, getTableName());
}

/*
Expand All @@ -127,8 +127,7 @@ public Mono<Boolean> exists() {
*/
@Override
public Mono<T> first() {
return this.template.doSelect(this.query.limit(1), this.domainType, getTableName(), this.returnType,
RowsFetchSpec::first);
return template.doSelect(query.limit(1), domainType, getTableName(), returnType, RowsFetchSpec::first);
}

/*
Expand All @@ -137,8 +136,7 @@ public Mono<T> first() {
*/
@Override
public Mono<T> one() {
return this.template.doSelect(this.query.limit(2), this.domainType, getTableName(), this.returnType,
RowsFetchSpec::one);
return template.doSelect(query.limit(2), domainType, getTableName(), returnType, RowsFetchSpec::one);
}

/*
Expand All @@ -147,11 +145,11 @@ public Mono<T> one() {
*/
@Override
public Flux<T> all() {
return this.template.doSelect(this.query, this.domainType, getTableName(), this.returnType, RowsFetchSpec::all);
return template.doSelect(query, domainType, getTableName(), returnType, RowsFetchSpec::all);
}

private SqlIdentifier getTableName() {
return this.tableName != null ? this.tableName : this.template.getTableName(this.domainType);
return tableName != null ? tableName : template.getTableName(domainType);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public ReactiveUpdate update(Class<?> domainType) {

Assert.notNull(domainType, "DomainType must not be null");

return new ReactiveUpdateSupport(this.template, domainType, Query.empty(), null);
return new ReactiveUpdateSupport(template, domainType, Query.empty(), null);
}

static class ReactiveUpdateSupport implements ReactiveUpdate, TerminatingUpdate {
Expand Down Expand Up @@ -74,7 +74,7 @@ public UpdateWithQuery inTable(SqlIdentifier tableName) {

Assert.notNull(tableName, "Table name must not be null");

return new ReactiveUpdateSupport(this.template, this.domainType, this.query, tableName);
return new ReactiveUpdateSupport(template, domainType, query, tableName);
}

/*
Expand All @@ -86,7 +86,7 @@ public TerminatingUpdate matching(Query query) {

Assert.notNull(query, "Query must not be null");

return new ReactiveUpdateSupport(this.template, this.domainType, query, this.tableName);
return new ReactiveUpdateSupport(template, domainType, query, tableName);
}

/*
Expand All @@ -98,11 +98,11 @@ public Mono<Integer> apply(Update update) {

Assert.notNull(update, "Update must not be null");

return this.template.doUpdate(this.query, update, this.domainType, getTableName());
return template.doUpdate(query, update, domainType, getTableName());
}

private SqlIdentifier getTableName() {
return this.tableName != null ? this.tableName : this.template.getTableName(this.domainType);
return tableName != null ? tableName : template.getTableName(this.domainType);
}
}
}

0 comments on commit b605daa

Please sign in to comment.