committed by
Jens Schauder
parent
a1f2297c20
commit
dc2e14ce81
@@ -19,15 +19,11 @@ import static java.time.LocalDateTime.*;
|
||||
import static java.time.ZoneId.*;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.Period;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@@ -442,7 +442,7 @@ public class MappingR2dbcConverter extends MappingRelationalConverter implements
|
||||
|
||||
Object id = propertyAccessor.getProperty(idProperty);
|
||||
if (idProperty.getType().isPrimitive()) {
|
||||
idPropertyUpdateNeeded = id instanceof Number && ((Number) id).longValue() == 0;
|
||||
idPropertyUpdateNeeded = id instanceof Number number && number.longValue() == 0;
|
||||
} else {
|
||||
idPropertyUpdateNeeded = id == null;
|
||||
}
|
||||
|
||||
@@ -297,8 +297,7 @@ abstract class NamedParameterUtils {
|
||||
}
|
||||
k++;
|
||||
Object entryItem = entryIter.next();
|
||||
if (entryItem instanceof Object[]) {
|
||||
Object[] expressionList = (Object[]) entryItem;
|
||||
if (entryItem instanceof Object[] expressionList) {
|
||||
actualSql.append('(');
|
||||
for (int m = 0; m < expressionList.length; m++) {
|
||||
if (m > 0) {
|
||||
@@ -520,8 +519,7 @@ abstract class NamedParameterUtils {
|
||||
|
||||
Object valueToBind = iterator.next();
|
||||
|
||||
if (valueToBind instanceof Object[]) {
|
||||
Object[] objects = (Object[]) valueToBind;
|
||||
if (valueToBind instanceof Object[] objects) {
|
||||
for (Object object : objects) {
|
||||
bind(target, markers, object);
|
||||
}
|
||||
|
||||
@@ -227,6 +227,6 @@ public class OutboundRow implements Map<SqlIdentifier, Parameter>, Cloneable {
|
||||
}
|
||||
|
||||
private static Object convertKeyIfNecessary(Object key) {
|
||||
return key instanceof String ? SqlIdentifier.unquoted((String) key) : key;
|
||||
return key instanceof String string ? SqlIdentifier.unquoted(string) : key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ abstract class ReactivePageableExecutionUtils {
|
||||
return totalSupplier.map(total -> new PageImpl<>(content, pageable, total));
|
||||
}
|
||||
|
||||
if (content.size() != 0 && pageable.getPageSize() > content.size()) {
|
||||
if (!content.isEmpty() && pageable.getPageSize() > content.size()) {
|
||||
return Mono.just(new PageImpl<>(content, pageable, pageable.getOffset() + content.size()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user