DATACMNS-1171 - Do not create PersistentEntity for unsupported Kotlin classes.

We now reject unsupported Kotlin classes from the MappingContext by default by not creating persistent entities.

Original pull request: #245.
This commit is contained in:
Mark Paluch
2017-09-25 08:58:00 +02:00
committed by Oliver Gierke
parent d9d0d594e5
commit cc0ab54c38
4 changed files with 69 additions and 4 deletions

View File

@@ -45,6 +45,7 @@ import org.springframework.util.StringUtils;
*
* @author Oliver Gierke
* @author Thomas Darimont
* @author Mark Paluch
*/
public class AbstractMappingContextUnitTests {
@@ -210,6 +211,16 @@ public class AbstractMappingContextUnitTests {
assertHasEntityFor(TreeMap.class, context, false);
}
@Test // DATACMNS-1171
public void shouldCreateEntityForKotlinDataClass() {
assertThat(context.getPersistentEntity(SimpleDataClass.class)).isNotNull();
}
@Test // DATACMNS-1171
public void shouldNotCreateEntityForSyntheticKotlinClass() {
assertThat(context.getPersistentEntity(TypeCreatingSyntheticClass.class)).isNotNull();
}
@Test // DATACMNS-695
public void persistentPropertyPathTraversesGenericTypesCorrectly() {
assertThat(context.getPersistentPropertyPath("field.wrapped.field", Outer.class)).hasSize(3);