@@ -865,12 +865,10 @@ public class AsyncCassandraTemplate
|
||||
return statement.getPageSize();
|
||||
}
|
||||
|
||||
if (getAsyncCqlOperations() instanceof CassandraAccessor) {
|
||||
if (getAsyncCqlOperations() instanceof CassandraAccessor accessor) {
|
||||
|
||||
CassandraAccessor accessor = (CassandraAccessor) getAsyncCqlOperations();
|
||||
|
||||
if (accessor.getFetchSize() != -1) {
|
||||
return accessor.getFetchSize();
|
||||
if (accessor.getPageSize() != -1) {
|
||||
return accessor.getPageSize();
|
||||
}
|
||||
}
|
||||
class GetConfiguredPageSize implements AsyncSessionCallback<Integer>, CqlProvider {
|
||||
|
||||
@@ -961,7 +961,7 @@ public class CassandraTemplate implements CassandraOperations, ApplicationEventP
|
||||
protected <T> T maybeCallBeforeConvert(T object, CqlIdentifier tableName) {
|
||||
|
||||
if (null != entityCallbacks) {
|
||||
return (T) entityCallbacks.callback(BeforeConvertCallback.class, object, tableName);
|
||||
return entityCallbacks.callback(BeforeConvertCallback.class, object, tableName);
|
||||
}
|
||||
|
||||
return object;
|
||||
@@ -970,7 +970,7 @@ public class CassandraTemplate implements CassandraOperations, ApplicationEventP
|
||||
protected <T> T maybeCallBeforeSave(T object, CqlIdentifier tableName, Statement<?> statement) {
|
||||
|
||||
if (null != entityCallbacks) {
|
||||
return (T) entityCallbacks.callback(BeforeSaveCallback.class, object, tableName, statement);
|
||||
return entityCallbacks.callback(BeforeSaveCallback.class, object, tableName, statement);
|
||||
}
|
||||
|
||||
return object;
|
||||
|
||||
@@ -296,9 +296,7 @@ public class StatementFactory {
|
||||
|
||||
boolean insertNulls;
|
||||
|
||||
if (options instanceof InsertOptions) {
|
||||
|
||||
InsertOptions insertOptions = (InsertOptions) options;
|
||||
if (options instanceof InsertOptions insertOptions) {
|
||||
insertNulls = insertOptions.isInsertNulls();
|
||||
} else {
|
||||
insertNulls = false;
|
||||
@@ -879,9 +877,7 @@ public class StatementFactory {
|
||||
|
||||
Assert.notNull(insert, "Insert must not be null");
|
||||
|
||||
if (writeOptions instanceof InsertOptions) {
|
||||
|
||||
InsertOptions insertOptions = (InsertOptions) writeOptions;
|
||||
if (writeOptions instanceof InsertOptions insertOptions) {
|
||||
|
||||
if (insertOptions.isIfNotExists()) {
|
||||
insert = insert.ifNotExists();
|
||||
@@ -910,9 +906,7 @@ public class StatementFactory {
|
||||
com.datastax.oss.driver.api.querybuilder.update.Update updateToUse = QueryOptionsUtil.addWriteOptions(update,
|
||||
writeOptions);
|
||||
|
||||
if (writeOptions instanceof UpdateOptions) {
|
||||
|
||||
UpdateOptions updateOptions = (UpdateOptions) writeOptions;
|
||||
if (writeOptions instanceof UpdateOptions updateOptions) {
|
||||
|
||||
if (updateOptions.isIfExists()) {
|
||||
updateToUse = updateToUse.ifExists();
|
||||
@@ -936,9 +930,7 @@ public class StatementFactory {
|
||||
|
||||
Delete deleteToUse = QueryOptionsUtil.addWriteOptions(delete, writeOptions);
|
||||
|
||||
if (writeOptions instanceof DeleteOptions) {
|
||||
|
||||
DeleteOptions deleteOptions = (DeleteOptions) writeOptions;
|
||||
if (writeOptions instanceof DeleteOptions deleteOptions) {
|
||||
|
||||
if (deleteOptions.isIfExists()) {
|
||||
deleteToUse = deleteToUse.where().ifExists();
|
||||
|
||||
@@ -232,6 +232,7 @@ public class MappingCassandraConverter extends AbstractCassandraConverter
|
||||
* @since 3.0
|
||||
*/
|
||||
public UserTypeResolver getUserTypeResolver() {
|
||||
|
||||
return this.userTypeResolver != null ? this.userTypeResolver : getMappingContext().getUserTypeResolver();
|
||||
}
|
||||
|
||||
@@ -256,14 +257,8 @@ public class MappingCassandraConverter extends AbstractCassandraConverter
|
||||
* @see org.springframework.data.cassandra.core.mapping.CassandraPersistentEntity
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private <S> ConvertingPropertyAccessor<S> newConvertingPropertyAccessor(S source,
|
||||
CassandraPersistentEntity<?> entity) {
|
||||
PersistentPropertyAccessor<S> propertyAccessor = source instanceof PersistentPropertyAccessor
|
||||
? (PersistentPropertyAccessor<S>) source
|
||||
: entity.getPropertyAccessor(source);
|
||||
|
||||
return new ConvertingPropertyAccessor<>(propertyAccessor, getConversionService());
|
||||
|
||||
private <S> ConvertingPropertyAccessor<S> newConvertingPropertyAccessor(S source, CassandraPersistentEntity<?> entity) {
|
||||
return new ConvertingPropertyAccessor<>(entity.getPropertyAccessor(source), getConversionService());
|
||||
}
|
||||
|
||||
private <S> CassandraPersistentEntityParameterValueProvider newParameterValueProvider(ConversionContext context,
|
||||
|
||||
@@ -146,8 +146,7 @@ public class SchemaFactory {
|
||||
|
||||
if (property.isCompositePrimaryKey()) {
|
||||
|
||||
CassandraPersistentEntity<?> primaryKeyEntity = mappingContext
|
||||
.getRequiredPersistentEntity(property.getRawType());
|
||||
CassandraPersistentEntity<?> primaryKeyEntity = mappingContext.getRequiredPersistentEntity(property.getRawType());
|
||||
|
||||
for (CassandraPersistentProperty primaryKeyProperty : primaryKeyEntity) {
|
||||
|
||||
@@ -406,9 +405,8 @@ public class SchemaFactory {
|
||||
public boolean equals(@Nullable Object o) {
|
||||
if (this == o)
|
||||
return true;
|
||||
if (!(o instanceof com.datastax.oss.driver.api.core.type.UserDefinedType))
|
||||
if (!(o instanceof UserDefinedType that))
|
||||
return false;
|
||||
com.datastax.oss.driver.api.core.type.UserDefinedType that = (com.datastax.oss.driver.api.core.type.UserDefinedType) o;
|
||||
return isFrozen() == that.isFrozen() && Objects.equals(getName(), that.getName());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user