-->
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.  [ 3 posts ] 
Author Message
 Post subject: Mapping <element> for a UserType
PostPosted: Sat Dec 03, 2005 3:33 am 
Newbie

Joined: Mon Nov 28, 2005 4:41 pm
Posts: 8
Location: Mountain View, CA
Hello,

I'd like to know what's needed to accomplish the mapping for an <element> that uses a UserType.

Thanks in advance.

Randall Schulz


Hibernate version:
3.1 (rc3)

Mapping documents:
Code:
<component name='extra' ... >
   <set name='flags' table='EXTRA_FLAGS'>
      <key column='HID'/>
      <element type='boolean'/>
   </set>

   ...

   <map name='numberEntries' table='EXTRA_NUMBERS'>
      <key column='HID'/>
      <map-key column='NUMBER_NAME' type='string'/>
      <element
         column='NUMBER_VALUES'
         type='MultiNumberUserType'
      />
   </map>
</component>


Code between sessionFactory.openSession() and session.close():
n/a

Full stack trace of any exception that occurs:
Code:
Dec 2, 2005 10:33:23 PM org.hibernate.tool.hbm2ddl.SchemaExport main
SEVERE: Error creating schema
org.hibernate.MappingException: Could not determine type for: MultiNumberUserType, for columns: [org.hibernate.mapping.Column(NUMBER_VALUES)]
        at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:266)
        at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:137)
        at org.hibernate.mapping.Column.getSqlType(Column.java:181)
        at org.hibernate.mapping.Table.sqlCreateString(Table.java:349)
        at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:737)
        at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:97)
        at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:64)
        at org.hibernate.tool.hbm2ddl.SchemaExport.main(SchemaExport.java:377)


Name and version of the database you are using:
MySQL 5.0

The generated SQL (show_sql=true):
None so far...


Top
 Profile  
 
 Post subject: Hbm2ddl Failing for UserType in <element> Mapping
PostPosted: Sat Dec 03, 2005 2:20 pm 
Newbie

Joined: Mon Nov 28, 2005 4:41 pm
Posts: 8
Location: Mountain View, CA
Hi,

It occurred to me that my subject left out a key fact, that it was the DDL generation in hbm2ddl that I'm having trouble with, and perhaps for that reason it did not attract the attention of someone who can help me out.

Randall Schulz


Top
 Profile  
 
 Post subject: D'Oh!
PostPosted: Sat Dec 03, 2005 2:27 pm 
Newbie

Joined: Mon Nov 28, 2005 4:41 pm
Posts: 8
Location: Mountain View, CA
Hi,

I finally came upon the answer here:

hbm2ddl - Could not determine type for custom UserType


Sorry not to perform my due diligence adequately (I did try...)


Randall Schulz


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

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.