@@ -113,6 +113,16 @@ class EntityOperations {
|
||||
return getRequiredPersistentEntity(entityClass).getTableName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Introspect the given {@link Class result type} in the context of the {@link Class entity type} whether the returned
|
||||
* type is a projection and what property paths are participating in the projection.
|
||||
*
|
||||
* @param resultType the type to project on. Must not be {@literal null}.
|
||||
* @param entityType the source domain type. Must not be {@literal null}.
|
||||
* @return the introspection result.
|
||||
* @since 3.4
|
||||
* @see EntityProjectionIntrospector#introspect(Class, Class)
|
||||
*/
|
||||
public <M, D> EntityProjection<M, D> introspectProjection(Class<M> resultType, Class<D> entityType) {
|
||||
return introspector.introspect(resultType, entityType);
|
||||
}
|
||||
|
||||
@@ -196,12 +196,6 @@ public class MappingCassandraConverter extends AbstractCassandraConverter
|
||||
return getCodecRegistry().codecFor(cassandraTypeResolver.resolve(property).getDataType());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link ProjectionFactory} for this converter.
|
||||
*
|
||||
* @return will never be {@literal null}.
|
||||
* @since 3.4
|
||||
*/
|
||||
@Override
|
||||
public ProjectionFactory getProjectionFactory() {
|
||||
return projectionFactory;
|
||||
@@ -1335,7 +1329,14 @@ public class MappingCassandraConverter extends AbstractCassandraConverter
|
||||
this.elementConverter = elementConverter;
|
||||
}
|
||||
|
||||
public ConversionContext forProperty(String name) {
|
||||
/**
|
||||
* Obtain the {@link ConversionContext} for the property identified by the given name.
|
||||
*
|
||||
* @param name must not be {@literal null}.
|
||||
* @return never {@literal null}.
|
||||
* @since 3.4
|
||||
*/
|
||||
ConversionContext forProperty(String name) {
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1581,7 +1582,7 @@ public class MappingCassandraConverter extends AbstractCassandraConverter
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConversionContext forProperty(String name) {
|
||||
ConversionContext forProperty(String name) {
|
||||
|
||||
EntityProjection<?, ?> property = projection.findProperty(name);
|
||||
if (property == null) {
|
||||
|
||||
@@ -102,9 +102,10 @@ public interface CassandraPersistentProperty
|
||||
void setForceQuote(boolean forceQuote);
|
||||
|
||||
/**
|
||||
* Return whether the property has an explicitly configured column name.
|
||||
* Return whether the property has an explicitly configured column name. Eg. via {@link Column#value()},
|
||||
* {@link PrimaryKey#value()} or {@link PrimaryKeyColumn#name()}
|
||||
*
|
||||
* @return
|
||||
* @return {@literal true} if a configured column name is present and non empty.
|
||||
* @since 3.4
|
||||
*/
|
||||
boolean hasExplicitColumnName();
|
||||
|
||||
@@ -1050,7 +1050,7 @@ public class MappingCassandraConverterUnitTests {
|
||||
assertThat(converted.tuple.firstname).isEqualTo("Two");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // GH-1202
|
||||
void shouldConsiderNestedProjections() {
|
||||
|
||||
DefaultTupleValue value = new DefaultTupleValue(
|
||||
|
||||
Reference in New Issue
Block a user