-->
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.  [ 4 posts ] 
Author Message
 Post subject: Increment Generator Params
PostPosted: Sun Feb 05, 2006 10:17 am 
Newbie

Joined: Thu Aug 04, 2005 3:51 pm
Posts: 10
Hello,

I'm trying to get a simple increment generator working on a MySQL database that I'm running on my notebook computer. The generator won't instatiate. I figure I must have forgotten some params. I've looked all over this website and the reference docs for params that I might be missing; however, I don't see the increment generator described anywhere -- at least not fully.

I've also read the source code and short documentation for class package org.hibernate.id.IncrementGenerator

Could someone please point to where I should look for a complete description of the increment generator (and other generators for that matter)?

Thanks!
P.

Hibernate version:
hibernate2


Mapping documents:
>
<class
name="com.myco.product.dao.hibernate.entity.ObjTypHibernateEntity"
table="OBJTYP"
>
<id
name="ID"
column="ID"
type="java.lang.Long"
unsaved-value="null"
>
<generator class="increment"> </generator>
</id>

Full stack trace of any exception that occurs:
ehcache.hibernate.Provider
Feb 5, 2006 3:20:30 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
Feb 5, 2006 3:20:30 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
About to throw ExceptionInInitializerError: net.sf.hibernate.MappingException: could not instantiate id generator
java.lang.NoClassDefFoundError
at de.kemaiev.elektra.dao.hibernate.AbstractHibernateDAO.findAll(AbstractHibernateDAO.java:130)
at de.kemaiev.elektra.dao.hibernate.ObjTypHibernateDAO.findAll(ObjTypHibernateDAO.java:31)
at de.kemaiev.elektra

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


Top
 Profile  
 
 Post subject: Re: Increment Generator Params
PostPosted: Wed Feb 08, 2006 8:35 am 
Beginner
Beginner

Joined: Mon Jan 30, 2006 2:28 am
Posts: 47
Location: INDIA
Pls try to use this format sample code
*******************************************************
<hibernate-mapping package="hibernate.loginDB">

<class name="Userlogin" table="userlogin">
<id name="id" column="ID" type="integer">
<generator class="increment"/>
</id>

<property name="password" column="PASSWORD" type="string" not-null="true" />

</class>
</hibernate-mapping>

********************************************************

Userlogin --- > Name of the mapping file
userlogin ------> Database table name
id ------> particular field of the Userlogin.java
ID ---- > db column name

_________________
A.Edward Durai
"The things which are impossible with men are possible with God."


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 08, 2006 2:00 pm 
Regular
Regular

Joined: Fri Sep 09, 2005 11:35 am
Posts: 101
does not look like a parameter problem. You are getting a java.lang.NoClassDefFoundError. So check your log files for more info. You might be missing some jar files.


Top
 Profile  
 
 Post subject: Change of Plans
PostPosted: Fri Feb 10, 2006 10:55 am 
Newbie

Joined: Thu Aug 04, 2005 3:51 pm
Posts: 10
Thanks for the replies. I tried to do as suggested, but it didn't work the way I'd hoped. Maybe I did something wrong...

Part of the problem is that I was using MySQL for the database and was trying to refactor from an Oracle database. The Oracle app uses sequences whereas MySQL doesn't. So I had to think of another strategy. That's why I tried using the increment generator.

Anyway, I've decided to scrap MySQL and use Personal Oracle XE for my notebook computer instead. It makes things easier all-around because I don't have to refactor.

It all comes down to money in the end. I get paid to design and develop applications, not to configure stuff. As soon as I see that something is going to cause a problem, I have to either bail out or do in on my own time. This time I chose to bail out :)

Thanks again for the help!


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