Hello,
I'm trying to mape a <many-to-any> property in a Class.
I'm implementing UserTyte Interface to construct my own types.
In the beginning i had problems with my class
ClassToIntegerMapper is a Class that extends another Class: ClassToInteger, that is a the implementation of UserType Interface.
In this mapper i'm declaring my own types, in the beginnig Integer and String for simplicity.
hibernate seems that can found the class ClassToIntegerMapper, but now it's giving to me this error:
[ObjectDbAccess] *ERROR* (**) Unable to create SessionFactory: Cannot instantiate custom type: ClassToIntegerMapper
[ObjectDbAccess] *ERROR* (*) Unable to export tables - Cannot instantiate custom type: ClassToIntegerMapper
Can anyOne help me with this.
Thank you,
J.M
My schema:
Code:
<class name="NetworkElement" table="NETWORK_ELEMENTS">
<id name="objectId" column="network_element_id" type="long" unsaved-value="null">
<generator class="hilo"/>
</id>
<property name="id" column="id" type="string"/>
<property name="type" column="type" type="string"/>
<property name="intId" column="int_id" type="integer"/>
<property name="parentIntId" column="parent_int_id" type="integer"/>
<property name="name" column="name" type="string"/>
<many-to-one name="itsParent"
class="NetworkElement"
column="itsParent"
cascade="none"/>
<many-to-one name="itsChildren"
class="NetworkElementList"
column="itsChildren"
cascade="all"
/>
<map name="itsParameters"
table="Element_Parameters"
cascade="all"
>
<key column="network_parameter_map"/>
<index column="network_parameter_map_key" type="string"/>
<many-to-any id-type="long" meta-type="ClassToIntegerMapper">
<column name="Type" />
<column name="Id" />
</many-to-any>
</map>