Backslash
unread,Jun 25, 2008, 11:55:11 AM6/25/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to H2 Database
Hello,
I recently downloaded the 2008-06-21 build of H2 for use with
Hibernate. However, when the tables are being constructed, statements
such as the following are being sent.
create table Poller$PolleeTime (id bigint generated by default as
identity, date binary(255), expired bit not null, nextDate timestamp,
primary key (id))
This causes an exception to occur as bellow. I tried to search for a
way to have hibernate not use "$" for subclasses as an alternative,
but didn't find anything obvious, and not using subclasses is not an
option either. Does anyone know of a work around for this so I can
get hibernate working? I also examined the Parser class in H2 but
found...
// $ is not supported at this time (compatibility
for
// PostgreSQL: $1 )
org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement CREATE
TABLE POLLER$[*]POLLEETIME (ID BIGINT GENERATED BY DEFAULT AS
IDENTITY, DATE BINARY(255), EXPIRED BIT NOT NULL, NEXTDATE TIMESTAMP,
PRIMARY KEY (ID)) ; expected (; SQL statement:
create table Poller$PolleeTime (id bigint generated by default as
identity, date binary(255), expired bit not null, nextDate timestamp,
primary key (id)) [42001-74]
at org.h2.message.Message.getSQLException(Message.java:103)
at org.h2.message.Message.getSQLException(Message.java:114)
at org.h2.message.Message.getSyntaxError(Message.java:139)
at org.h2.command.Parser.read(Parser.java:2396)
at org.h2.command.Parser.parseCreateTable(Parser.java:4417)
at org.h2.command.Parser.parseCreate(Parser.java:3285)
at org.h2.command.Parser.parsePrepared(Parser.java:323)
at org.h2.command.Parser.parse(Parser.java:290)
at org.h2.command.Parser.parse(Parser.java:262)
at org.h2.command.Parser.prepareCommand(Parser.java:234)
at org.h2.engine.Session.prepareLocal(Session.java:285)
at org.h2.engine.Session.prepareCommand(Session.java:246)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:
1030)
at org.h2.jdbc.JdbcStatement.executeUpdate(JdbcStatement.java:113)
at
org.apache.commons.dbcp.DelegatingStatement.executeUpdate(DelegatingStatement.java:
228)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:
150)
at
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:
323)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:
1304)
at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:
854)
at
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:
669)
at
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:
126)
at
com.ncompass_inc.persistence.factory.hibernate.HibernateEntityManagerFactoryFactory.getEntityManagerFactory(HibernateEntityManagerFactoryFactory.java:
50)
at
com.ncompass_inc.persistence.EntityUtils.getEntityManager(EntityUtils.java:
30)
at
com.ncompass_inc.poll.XmlStorePollerTest.testXmlStorePoller(XmlStorePollerTest.java:
22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:
130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
196)