I'm trying to access HSQLDB through Hibernate over a Spring local session factory. HSQLDB 1.7.2 introduced sequences and identity columns, and the Hibernate HSQLDB Dialect doesn't seem to support it. Is there any plans to add it in the near future? (I know I can work around with a hilo generator, just out of curiosity and would still prefer a sequence.)
--mr
Hibernate version:
2.1.6
Mapping documents:
Code:
<id name="id_" column="id" type="long" unsaved-value="0" access="field">
<generator class="sequence">
<param name="sequence">Id_Generator</param>
</generator>
</id>
Code between sessionFactory.openSession() and session.close():Full stack trace of any exception that occurs:Code:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'session-factory' defined in file [E:\java\main-context.xml]: Initialization of bean failed; nested exception is net.sf.hibernate.MappingException: could not instantiate id generator
net.sf.hibernate.MappingException: could not instantiate id generator
at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:82)
at net.sf.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:82)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:635)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:716)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:42)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:136)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:791)
at org.springframework.orm.hibernate.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:467)
at org.springframework.orm.hibernate.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:405)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:205)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:204)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:136)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:230)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:284)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:83)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:68)
at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:59)
... 1 more
Caused by: net.sf.hibernate.MappingException: Dialect does not support sequences
at net.sf.hibernate.dialect.Dialect.getSequenceNextValString(Dialect.java:319)
at net.sf.hibernate.id.SequenceGenerator.configure(SequenceGenerator.java:62)
at net.sf.hibernate.id.IdentifierGeneratorFactory.create(IdentifierGeneratorFactory.java:78)
... 19 more
Name and version of the database you are using:
HSQLDB 1.7.2
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: