mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-06 00:32:18 +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:
1 parent
be66872249
commit
0e65efea57
4 files changed
+153
-1
No files matched your search
@@ -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