-->
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: problem with <generator class="vm"/>
PostPosted: Fri Feb 20, 2009 6:21 pm 
Regular
Regular

Joined: Wed Jan 28, 2009 8:31 pm
Posts: 54
hi it is me againt. I have a new problem with my id.
Code:

<hibernate-mapping package="ca.canassistance.pojo">
   <class
      name="Xc4dvoyPojo"
      table="XC4DVOY"
   >
      <meta attribute="sync-DAO">false</meta>
      <id
         name="id"
         type="integer"
         column="ID"
      >
         <generator class="vm"/>
      </id>


my code
Code:

public void save(ca.canassistance.pojo.Xc4dvoyPojo pojo)
         throws HibernateException, Exception {
      Session session = null;

      // Transaction tx = null;
      try {
         session = HibernateUtil.getSessionFactory().getCurrentSession();

         session.beginTransaction();
         session.save(pojo);

         session.getTransaction().commit();

      } catch (HibernateException e) {
         session.getTransaction().rollback();
         e.printStackTrace();

         throw new ServiceException(e.getMessage(), e);

      } finally {

         HibernateUtil.getSessionFactory().close();

      }

   }



and the console
Quote:

Initial SessionFactory creation failed.org.hibernate.MappingException: could not instantiate id generator [entity-name=ca.canassistance.pojo.Xc4dvoyPojo]
but evething was working very good with hibernate 2

also I try
Code:

<generator class="narative"/>

and it fail to thank you for help


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2009 7:37 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
I have never heard of ID generators named 'vm' or 'narative'. The one that comes closest is 'native'. A list of built-in ID generators can be found here: http://www.hibernate.org/hib_docs/v3/re ... -generator


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.