mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1804 - Kotlin: Generating collection with wildcard type - Get error BeanNotRegisteredException: Error with association to [null] from [...Foo.manyProperty]. Is null registered?
This commit is contained in:
@@ -313,10 +313,17 @@ public class DeployCreateProperties {
|
||||
|
||||
Type[] typeArgs = ptype.getActualTypeArguments();
|
||||
if (typeArgs.length == 1) {
|
||||
// probably a Set or List
|
||||
// expecting set or list
|
||||
if (typeArgs[0] instanceof Class<?>) {
|
||||
return (Class<?>) typeArgs[0];
|
||||
}
|
||||
if (typeArgs[0] instanceof WildcardType) {
|
||||
final Type[] upperBounds = ((WildcardType) typeArgs[0]).getUpperBounds();
|
||||
if (upperBounds.length == 1 && upperBounds[0] instanceof Class<?>) {
|
||||
// kotlin generated wildcard type
|
||||
return (Class<?>) upperBounds[0];
|
||||
}
|
||||
}
|
||||
// throw new RuntimeException("Unexpected Parameterised Type? "+typeArgs[0]);
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user