[jboss-user] [JBoss Seam] - How to generate Id automatically?

anarinsky do-not-reply at jboss.com
Thu Apr 5 21:43:40 EDT 2007


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


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035206#4035206

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035206



More information about the jboss-user mailing list