You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at java.util.Arrays$ArrayList.get(Arrays.java:2866)
at com.mysema.query.codegen.Property.getParameter(Property.java:135)
at com.mysema.query.codegen.EntitySerializer.serializeProperties(EntitySerializer.java:784)
at com.mysema.query.codegen.EntitySerializer.serialize(EntitySerializer.java:615)
at com.mysema.query.jpa.codegen.HibernateDomainExporter.write(HibernateDomainExporter.java:517)
I believe this is because in HibernateDomainExporter (from 3.1.1) at line 377 you expect the field to have one generic type (the "componentType") only. For j.u.Map there are two!
I have fixed this locally by replacing the code:
if (entityName != null) {
Type componentType = typeFactory.get(Class.forName(entityName));
propertyType = new SimpleType(propertyType, componentType);
}
With:
if (entityName != null) {
if (collection.isMap()) {
Type keyType = typeFactory.get(Class.forName(propertyType.getParameters().get(0).getFullName()));
Type valueType = typeFactory.get(Class.forName(entityName));
propertyType = new SimpleType(propertyType, keyType, valueType);
} else {
Type componentType = typeFactory.get(Class.forName(entityName));
propertyType = new SimpleType(propertyType, componentType);
}
}
I suspect mine is a nastier hack than your choice of solution would be, but unfortunately I don't have much time left to look into what the more elegant solution is!
Thanks
The text was updated successfully, but these errors were encountered:
Yes - apologies - I will do, just running on a real tight time constraint right now and isolating the specifics is going to take time away from my project.
When I set the HibernateDomainExporter loose with a domain class with this field:
And this in the hbm.xml:
I get this exception:
I believe this is because in HibernateDomainExporter (from 3.1.1) at line 377 you expect the field to have one generic type (the "componentType") only. For j.u.Map there are two!
I have fixed this locally by replacing the code:
With:
I suspect mine is a nastier hack than your choice of solution would be, but unfortunately I don't have much time left to look into what the more elegant solution is!
Thanks
The text was updated successfully, but these errors were encountered: