Hi,
I'm trying to update from hibernate 5.2.18 to 5.4.4 and I'm facing a regression with a type in CompositeUserType that hibernate can't handle.
To simplify my problem, I have the following “{{Population”}}entity, containing a non entity “{{Matrix” object:}}
{code:java}// Some comments here public class Population { public Matrix effective; }{code}
And the following xml mapping:
{code:xml}<?xml version="1.0" encoding="UTF-8"?> <hibernate-mapping xmlns="http://www.hibernate.org/xsd/hibernate-mapping" xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-mapping classpath://org/hibernate/hibernate-mapping-4.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" default-access="field" auto-import="true" package="fr.mycompany.mypackage"> <class name="fr.mycompany.mypackage.entities.Population" table="population" abstract="false"> <property name=" recruitmentDistribution effective " access="field" type="fr.mycompany.mypackage.types.hibernate.MatrixType"> <column name="effective_name"/> <column name="effective_dim"/> <column name="effective_dimNames"/> <column name="effective_semantics"/> <column name="effective_data"/> </property> </class> </hibernate-mapping>{code}
“Matrix” object can be resumed as:
{code:java}public class Matrix { protected String name; protected List<String> dimNames; protected List<?>[] semantics; protected Object data; }{code}
Since, update, hibernate complains about a strange type into 'Matrix' object : java.util.List<?>\[] It's ok, that hibernate can't handle that, but why does hibernate throw the following error for *a field inside a CompositeUserType* ?
{code:java}java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:217) at org.hibernate.annotations.common.reflection.java.JavaXMethod.create(JavaXMethod.java:27) at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getXMethod(JavaReflectionManager.java:181) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethods(JavaXClass.java:120) at org.hibernate.jpa.event.internal.CallbackBuilderLegacyImpl.resolveEmbeddableCallbacks(CallbackBuilderLegacyImpl.java:251) at org.hibernate.jpa.event.internal.CallbackBuilderLegacyImpl.buildCallbacksForEmbeddable(CallbackBuilderLegacyImpl.java:91) at org.hibernate.event.service.internal.EventListenerRegistryImpl.prepare(EventListenerRegistryImpl.java:153) at org.hibernate.internal.SessionFactoryImpl.prepareEventListeners(SessionFactoryImpl.java:402) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:212) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462){code}
|
|