-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problems with UserType interface
PostPosted: Thu Dec 18, 2003 6:07 am 
Newbie

Joined: Tue Dec 16, 2003 6:08 am
Posts: 8
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>




Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.