Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>org.springframework.data</groupId>
<artifactId>spring-data-r2dbc</artifactId>
<version>1.1.0.BUILD-SNAPSHOT</version>
<version>1.1.0.gh-289-SNAPSHOT</version>

<name>Spring Data R2DBC</name>
<description>Spring Data module for R2DBC</description>
Expand All @@ -22,7 +24,7 @@
<dist.key>DATAR2DBC</dist.key>

<springdata.commons>2.3.0.BUILD-SNAPSHOT</springdata.commons>
<springdata.jdbc>2.0.0.BUILD-SNAPSHOT</springdata.jdbc>
<springdata.jdbc>2.0.0.DATAJDBC-490-SNAPSHOT</springdata.jdbc>
<springdata.relational>${springdata.jdbc}</springdata.relational>
<java-module-name>spring.data.r2dbc</java-module-name>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private PreparedOperation<Select> getMappedObject(SelectSpec selectSpec,
BindMarkers bindMarkers = this.dialect.getBindMarkersFactory().create();
Bindings bindings = Bindings.empty();

if (selectSpec.getCriteria() != null) {
if (!selectSpec.getCriteria().isEmpty()) {

BoundCondition mappedObject = this.updateMapper.getMappedObject(bindMarkers, selectSpec.getCriteria(), table,
entity);
Expand Down Expand Up @@ -203,7 +203,7 @@ private PreparedOperation<Update> getMappedObject(UpdateSpec updateSpec,

Update update;

if (updateSpec.getCriteria() != null) {
if (!updateSpec.getCriteria().isEmpty()) {

BoundCondition boundCondition = this.updateMapper.getMappedObject(bindMarkers, updateSpec.getCriteria(), table,
entity);
Expand Down Expand Up @@ -237,7 +237,7 @@ private PreparedOperation<Delete> getMappedObject(DeleteSpec deleteSpec,
Bindings bindings = Bindings.empty();

Delete delete;
if (deleteSpec.getCriteria() != null) {
if (!deleteSpec.getCriteria().isEmpty()) {

BoundCondition boundCondition = this.updateMapper.getMappedObject(bindMarkers, deleteSpec.getCriteria(), table,
entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class SelectSpec {
private final Table table;
private final List<String> projectedFields;
private final List<Expression> selectList;
private final @Nullable Criteria criteria;
private final Criteria criteria;
private final Sort sort;
private final long offset;
private final int limit;
Expand Down Expand Up @@ -219,7 +219,7 @@ public static SelectSpec create(String table) {
* @since 1.1
*/
public static SelectSpec create(SqlIdentifier table) {
return new SelectSpec(Table.create(table), Collections.emptyList(), Collections.emptyList(), null,
return new SelectSpec(Table.create(table), Collections.emptyList(), Collections.emptyList(), Criteria.empty(),
Sort.unsorted(), -1, -1);
}

Expand Down Expand Up @@ -463,9 +463,9 @@ class UpdateSpec {
@Nullable
private final Update update;

private final @Nullable Criteria criteria;
private final Criteria criteria;

protected UpdateSpec(SqlIdentifier table, @Nullable Update update, @Nullable Criteria criteria) {
protected UpdateSpec(SqlIdentifier table, @Nullable Update update, Criteria criteria) {

this.table = table;
this.update = update;
Expand All @@ -490,7 +490,7 @@ public static UpdateSpec create(String table, Update update) {
* @since 1.1
*/
public static UpdateSpec create(SqlIdentifier table, Update update) {
return new UpdateSpec(table, update, null);
return new UpdateSpec(table, update, Criteria.empty());
}

/**
Expand All @@ -512,7 +512,6 @@ public Update getUpdate() {
return this.update;
}

@Nullable
public Criteria getCriteria() {
return this.criteria;
}
Expand All @@ -525,9 +524,9 @@ class DeleteSpec {

private final SqlIdentifier table;

private final @Nullable Criteria criteria;
private final Criteria criteria;

protected DeleteSpec(SqlIdentifier table, @Nullable Criteria criteria) {
protected DeleteSpec(SqlIdentifier table, Criteria criteria) {
this.table = table;
this.criteria = criteria;
}
Expand All @@ -550,7 +549,7 @@ public static DeleteSpec create(String table) {
* @since 1.1
*/
public static DeleteSpec create(SqlIdentifier table) {
return new DeleteSpec(table, null);
return new DeleteSpec(table, Criteria.empty());
}

/**
Expand All @@ -567,7 +566,6 @@ public SqlIdentifier getTable() {
return this.table;
}

@Nullable
public Criteria getCriteria() {
return this.criteria;
}
Expand Down
Loading