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:
committed by
Oliver Gierke
parent
d9d0d594e5
commit
cc0ab54c38
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user