Skip to content

Commit 61f3059

Browse files
Polishing.
Reduce method visibility and update javadoc. See: #1202
1 parent 0e89539 commit 61f3059

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/EntityOperations.java

+10
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ CqlIdentifier getTableName(Class<?> entityClass) {
113113
return getRequiredPersistentEntity(entityClass).getTableName();
114114
}
115115

116+
/**
117+
* Introspect the given {@link Class result type} in the context of the {@link Class entity type} whether the returned
118+
* type is a projection and what property paths are participating in the projection.
119+
*
120+
* @param resultType the type to project on. Must not be {@literal null}.
121+
* @param entityType the source domain type. Must not be {@literal null}.
122+
* @return the introspection result.
123+
* @since 3.4
124+
* @see EntityProjectionIntrospector#introspect(Class, Class)
125+
*/
116126
public <M, D> EntityProjection<M, D> introspectProjection(Class<M> resultType, Class<D> entityType) {
117127
return introspector.introspect(resultType, entityType);
118128
}

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/convert/MappingCassandraConverter.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,6 @@ private TypeCodec<Object> getCodec(CassandraPersistentProperty property) {
196196
return getCodecRegistry().codecFor(cassandraTypeResolver.resolve(property).getDataType());
197197
}
198198

199-
/**
200-
* Returns the {@link ProjectionFactory} for this converter.
201-
*
202-
* @return will never be {@literal null}.
203-
* @since 3.4
204-
*/
205199
@Override
206200
public ProjectionFactory getProjectionFactory() {
207201
return projectionFactory;
@@ -1335,7 +1329,14 @@ public ConversionContext(org.springframework.data.convert.CustomConversions conv
13351329
this.elementConverter = elementConverter;
13361330
}
13371331

1338-
public ConversionContext forProperty(String name) {
1332+
/**
1333+
* Obtain the {@link ConversionContext} for the property identified by the given name.
1334+
*
1335+
* @param name must not be {@literal null}.
1336+
* @return never {@literal null}.
1337+
* @since 3.4
1338+
*/
1339+
ConversionContext forProperty(String name) {
13391340
return this;
13401341
}
13411342

@@ -1581,7 +1582,7 @@ public ProjectingConversionContext(CustomConversions conversions, ContainerValue
15811582
}
15821583

15831584
@Override
1584-
public ConversionContext forProperty(String name) {
1585+
ConversionContext forProperty(String name) {
15851586

15861587
EntityProjection<?, ?> property = projection.findProperty(name);
15871588
if (property == null) {

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/CassandraPersistentProperty.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ default CqlIdentifier getRequiredColumnName() {
102102
void setForceQuote(boolean forceQuote);
103103

104104
/**
105-
* Return whether the property has an explicitly configured column name.
105+
* Return whether the property has an explicitly configured column name. Eg. via {@link Column#value()},
106+
* {@link PrimaryKey#value()} or {@link PrimaryKeyColumn#name()}
106107
*
107-
* @return
108+
* @return {@literal true} if a configured column name is present and non empty.
108109
* @since 3.4
109110
*/
110111
boolean hasExplicitColumnName();

spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/convert/MappingCassandraConverterUnitTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ void shouldConsiderElementAnnotationOnConstructor() {
10501050
assertThat(converted.tuple.firstname).isEqualTo("Two");
10511051
}
10521052

1053-
@Test
1053+
@Test // GH-1202
10541054
void shouldConsiderNestedProjections() {
10551055

10561056
DefaultTupleValue value = new DefaultTupleValue(

0 commit comments

Comments
 (0)