@@ -283,6 +283,7 @@ private <T> Class<T> transformClassToBeanClassLoaderClass(Class<T> entity) {
283283 }
284284
285285 @ Override
286+ @ SuppressWarnings ("unchecked" )
286287 public <R > R project (EntityProjection <R , ?> projection , Row row ) {
287288
288289 if (!projection .isProjection ()) {
@@ -665,7 +666,7 @@ private void writeWhereFromObject(Object source, Where sink, CassandraPersistent
665666 ? getMappingContext ().getRequiredPersistentEntity (compositeIdProperty )
666667 : entity ;
667668
668- writeWhere (MapId . class . cast ( id ) , sink , whereEntity );
669+ writeWhere (( MapId ) id , sink , whereEntity );
669670 return ;
670671 }
671672
@@ -725,18 +726,6 @@ private void writeWhere(MapId id, Where sink, CassandraPersistentEntity<?> entit
725726 }
726727 }
727728
728- private void writeWhere (ConvertingPropertyAccessor <?> accessor , Where sink , CassandraPersistentEntity <?> entity ) {
729-
730- Assert .isTrue (entity .isCompositePrimaryKey (),
731- () -> String .format ("Entity [%s] is not a composite primary key" , entity .getName ()));
732-
733- for (CassandraPersistentProperty property : entity ) {
734- TypeCodec <Object > codec = getCodec (property );
735- Object value = accessor .getProperty (property , codec .getJavaType ().getRawType ());
736- sink .put (property .getRequiredColumnName (), value );
737- }
738- }
739-
740729 private void writeTupleValue (ConvertingPropertyAccessor <?> propertyAccessor , TupleValue tupleValue ,
741730 CassandraPersistentEntity <?> entity ) {
742731
@@ -863,7 +852,7 @@ private Class<?> getTargetType(CassandraPersistentProperty property) {
863852 */
864853 @ Nullable
865854 @ SuppressWarnings ("unchecked" )
866- private <T > T getWriteValue (CassandraPersistentProperty property , ConvertingPropertyAccessor propertyAccessor ) {
855+ private <T > T getWriteValue (CassandraPersistentProperty property , ConvertingPropertyAccessor <?> propertyAccessor ) {
867856
868857 ColumnType cassandraTypeDescriptor = cassandraTypeResolver .resolve (property );
869858
@@ -914,7 +903,7 @@ private Object getWriteValue(@Nullable Object value, ColumnType columnType) {
914903 return writeMapInternal ((Map <Object , Object >) value , columnType );
915904 }
916905
917- TypeInformation <?> type = TypeInformation .of ((Class ) value .getClass ());
906+ TypeInformation <?> type = TypeInformation .of ((Class <?> ) value .getClass ());
918907 TypeInformation <?> actualType = type .getRequiredActualType ();
919908 BasicCassandraPersistentEntity <?> entity = getMappingContext ().getPersistentEntity (actualType .getType ());
920909
@@ -989,7 +978,6 @@ private Object writeMapInternal(Map<Object, Object> source, ColumnType type) {
989978 * @param requestedTargetType must not be {@literal null}.
990979 * @see org.springframework.data.cassandra.core.mapping.CassandraType
991980 */
992- @ SuppressWarnings ("unchecked" )
993981 @ Nullable
994982 private Object getPotentiallyConvertedSimpleValue (@ Nullable Object value , @ Nullable Class <?> requestedTargetType ) {
995983
@@ -1237,7 +1225,7 @@ public <T> T getParameterValue(Parameter<T, CassandraPersistentProperty> paramet
12371225 * Extension of {@link SpELExpressionParameterValueProvider} to recursively trigger value conversion on the raw
12381226 * resolved SpEL value.
12391227 */
1240- private class ConverterAwareSpELExpressionParameterValueProvider
1228+ private static class ConverterAwareSpELExpressionParameterValueProvider
12411229 extends SpELExpressionParameterValueProvider <CassandraPersistentProperty > {
12421230
12431231 private final ConversionContext context ;
@@ -1450,16 +1438,8 @@ private CassandraPersistentProperty getPersistentProperty(String name, TypeInfor
14501438 }
14511439 }
14521440
1453- private static class PropertyTranslatingPropertyAccessor <T > implements PersistentPropertyAccessor <T > {
1454-
1455- private final PersistentPropertyAccessor <T > delegate ;
1456- private final PersistentPropertyTranslator propertyTranslator ;
1457-
1458- private PropertyTranslatingPropertyAccessor (PersistentPropertyAccessor <T > delegate ,
1459- PersistentPropertyTranslator propertyTranslator ) {
1460- this .delegate = delegate ;
1461- this .propertyTranslator = propertyTranslator ;
1462- }
1441+ private record PropertyTranslatingPropertyAccessor <T > (PersistentPropertyAccessor <T > delegate ,
1442+ PersistentPropertyTranslator propertyTranslator ) implements PersistentPropertyAccessor <T > {
14631443
14641444 static <T > PersistentPropertyAccessor <T > create (PersistentPropertyAccessor <T > delegate ,
14651445 PersistentPropertyTranslator propertyTranslator ) {
@@ -1549,7 +1529,7 @@ static class MapPersistentPropertyAccessor implements PersistentPropertyAccessor
15491529 Map <String , Object > map = new LinkedHashMap <>();
15501530
15511531 @ Override
1552- public void setProperty (PersistentProperty <?> persistentProperty , Object o ) {
1532+ public void setProperty (PersistentProperty <?> persistentProperty , @ Nullable Object o ) {
15531533 map .put (persistentProperty .getName (), o );
15541534 }
15551535
0 commit comments