-->
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.  [ 2 posts ] 
Author Message
 Post subject: uuid.string generator fails
PostPosted: Wed Apr 19, 2006 10:22 am 
Newbie

Joined: Tue May 25, 2004 8:50 am
Posts: 8
Hi all,

I am trying to generate an id with the uuid.string generator, but Hibernate throws an exception. uuid.hex, however, does work as expected. Does anyone have a clue why the uuid.string does not work?

Thanks in advance!

Arjan Huijzer


Hibernate version: 3.1.2

Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

    <class name="org.musicweb.model.Disc" table="DISC">
        <id name="id" column="ID">
           <generator class="uuid.string"/>
        </id>
        <property name="title" column="TITLE"/>
        <property name="artistId" column="ARTIST_ID"/>
        <property name="year" column="YEAR"/>
    </class>

</hibernate-mapping>


Full stack trace of any exception that occurs:
org.hibernate.MappingException: could not instantiate id generator
at org.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:97)
at org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:152)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:181)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)

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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 19, 2006 10:38 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Most likely because there is no uuid.string generator. In fact, there isn't even a uuid.hex, any more, it's deprecated. Use plain old "uuid".


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.