0 Replies Latest reply on Oct 30, 2004 8:48 PM by empty11

    How to use the Sequence Generator

    empty11

      Hi.
      I've used the sequence of Oralce 9i.
      So I changed the @ID Annotation in the ManyToMany and OneToOne Relationship Tutorial as below.

      @Id(generate = GeneratorType.IDENTITY) => @Id(generate = GeneratorType.SEQUENCE, generator="EJB3_SEQ")

      and I've created the sequence as "EJB3_SEQ" to the Oracle 9i

      There is an error message after deploy it as below.

      09:31:53,075 ERROR [Ejb3Module] Starting failed jboss.j2ee:service=EJB3,module=Relationship.ejb3
      org.hibernate.MappingException: org.dom4j.DocumentException: Error on line 13 of document : The element type "generator" must be terminated by the matching end
      -tag "". Nested exception: The element type "generator" must be terminated by the matching end-tag "".
      at org.hibernate.cfg.Configuration.addXML(Configuration.java:301)
      at org.jboss.ejb3.HibernateSessionFactory.createSessionFactory(HibernateSessionFactory.java:131)
      at org.jboss.ejb3.Ejb3Module.createHibernateSessionFactory(Ejb3Module.java:206)
      at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:218)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)

      Please let me know how to use the sequence ?

      Regards