0 Replies Latest reply on Apr 5, 2007 9:43 PM by Alex Narinsky

    How to generate Id automatically?

    Alex Narinsky Newbie

      I use seam generator to generate entities based on the database. This database originally was generated by Hibernate using org.hibernate.tool.hbm2ddl.SchemaExportTask

      Id supposed to be auto generated. However, when I add @GeneratedValue to the Id getter I am getting the exception on startup:
      ObjectName: persistence.units:ear=spot4.ear,unitName=spot4
      State: FAILED
      Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: Missing sequence or table: hibernate_sequence
      I Depend On:
      jboss.jca:service=DataSourceBinding,name=spot4Datasource

      With the old variant of Hibernate this auto sequence generated worked fine with the following annotation used in Doclet:
      /**
      * @hibernate.id column="ID" generator-class="increment" unsaved-value="0"
      */
      Any suggestions? Thank you