Thanks for your quick response. I've changed to mySQLDialect and didn'st seem to help, ie:
[java] 21:40:22,921 INFO Dialect:152 - Using dialect: org.hibernate.dialect.MySQLDialect
Below is the complete log:
BUILD SUCCESSFUL
Total time: 7 seconds
C:\eclipse\workspace\hibernate>ant run -Daction=store
Buildfile: build.xml
clean:
[delete] Deleting directory C:\eclipse\workspace\hibernate\bin
[mkdir] Created dir: C:\eclipse\workspace\hibernate\bin
copy-resources:
[copy] Copying 4 files to C:\eclipse\workspace\hibernate\bin
[copy] Copied 2 empty directories to 1 empty directory under C:\eclipse\wor
kspace\hibernate\bin
compile:
[javac] Compiling 5 source files to C:\eclipse\workspace\hibernate\bin
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
run:
[java] 21:40:22,359 INFO Environment:514 - Hibernate 3.2.5
[java] 21:40:22,375 INFO Environment:547 - hibernate.properties not found
[java] 21:40:22,375 INFO Environment:681 - Bytecode provider name : cglib
[java] 21:40:22,375 INFO Environment:598 - using JDK 1.4 java.sql.Timestam
p handling
[java] 21:40:22,421 INFO Configuration:1426 - configuring from resource: /
hibernate.cfg.xml
[java] 21:40:22,421 INFO Configuration:1403 - Configuration resource: /hib
ernate.cfg.xml
[java] 21:40:22,625 INFO Configuration:553 - Reading mappings from resourc
e : events/Event.hbm.xml
[java] 21:40:22,703 INFO HbmBinder:300 - Mapping class: events.Event -> EV
ENTS
[java] 21:40:22,734 INFO HbmBinder:1422 - Mapping collection: events.Event
.participants -> PERSON_EVENT
[java] 21:40:22,734 INFO Configuration:553 - Reading mappings from resourc
e : events/Person.hbm.xml
[java] 21:40:22,765 INFO HbmBinder:300 - Mapping class: events.Person -> P
ERSON
[java] 21:40:22,765 INFO HbmBinder:1422 - Mapping collection: events.Perso
n.events -> PERSON_EVENT
[java] 21:40:22,765 INFO HbmBinder:1422 - Mapping collection: events.Perso
n.emailAddresses -> PERSON_EMAIL_ADDR
[java] 21:40:22,765 INFO Configuration:1541 - Configured SessionFactory: n
ull
[java] 21:40:22,828 INFO DriverManagerConnectionProvider:41 - Using Hibern
ate built-in connection pool (not for production use!)
[java] 21:40:22,828 INFO DriverManagerConnectionProvider:42 - Hibernate co
nnection pool size: 1
[java] 21:40:22,828 INFO DriverManagerConnectionProvider:45 - autocommit m
ode: false
[java] 21:40:22,828 INFO DriverManagerConnectionProvider:80 - using driver
: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost
[java] 21:40:22,828 INFO DriverManagerConnectionProvider:86 - connection p
roperties: {user=sa, password=****}
[java] 21:40:22,906 INFO SettingsFactory:89 - RDBMS: HSQL Database Engine,
version: 1.7.1
[java] 21:40:22,906 INFO SettingsFactory:90 - JDBC driver: HSQL Database E
ngine Driver, version: 1.7.1
[java] 21:40:22,921 INFO Dialect:152 - Using dialect: org.hibernate.dialec
t.MySQLDialect
[java] 21:40:22,921 INFO TransactionFactoryFactory:31 - Using default tran
saction strategy (direct JDBC transactions)
[java] 21:40:22,937 INFO TransactionManagerLookupFactory:33 - No Transacti
onManagerLookup configured (in JTA environment, use of read-write or transaction
al second-level cache is not recommended)
[java] 21:40:22,937 INFO SettingsFactory:143 - Automatic flush during befo
reCompletion(): disabled
[java] 21:40:22,937 INFO SettingsFactory:147 - Automatic session close at
end of transaction: disabled
[java] 21:40:22,937 INFO SettingsFactory:162 - Scrollable result sets: ena
bled
[java] 21:40:22,937 INFO SettingsFactory:170 - JDBC3 getGeneratedKeys(): d
isabled
[java] 21:40:22,937 INFO SettingsFactory:178 - Connection release mode: au
to
[java] 21:40:22,937 INFO SettingsFactory:202 - Maximum outer join fetch de
pth: 2
[java] 21:40:22,937 INFO SettingsFactory:205 - Default batch fetch size: 1
[java] 21:40:22,937 INFO SettingsFactory:209 - Generate SQL with comments:
disabled
[java] 21:40:22,937 INFO SettingsFactory:213 - Order SQL updates by primar
y key: disabled
[java] 21:40:22,937 INFO SettingsFactory:217 - Order SQL inserts for batch
ing: disabled
[java] 21:40:22,937 INFO SettingsFactory:386 - Query translator: org.hiber
nate.hql.ast.ASTQueryTranslatorFactory
[java] 21:40:22,937 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTran
slatorFactory
[java] 21:40:22,937 INFO SettingsFactory:225 - Query language substitution
s: {}
[java] 21:40:22,937 INFO SettingsFactory:230 - JPA-QL strict compliance: d
isabled
[java] 21:40:22,937 INFO SettingsFactory:235 - Second-level cache: enabled
[java] 21:40:22,937 INFO SettingsFactory:239 - Query cache: disabled
[java] 21:40:22,937 INFO SettingsFactory:373 - Cache provider: org.hiberna
te.cache.NoCacheProvider
[java] 21:40:22,937 INFO SettingsFactory:254 - Optimize cache for minimal
puts: disabled
[java] 21:40:22,937 INFO SettingsFactory:263 - Structured second-level cac
he entries: disabled
[java] 21:40:22,937 INFO SettingsFactory:283 - Echoing all SQL to stdout
[java] 21:40:22,937 INFO SettingsFactory:290 - Statistics: disabled
[java] 21:40:22,937 INFO SettingsFactory:294 - Deleted entity synthetic id
entifier rollback: disabled
[java] 21:40:22,937 INFO SettingsFactory:309 - Default entity-mode: pojo
[java] 21:40:22,937 INFO SettingsFactory:313 - Named query checking : enab
led
[java] 21:40:22,968 INFO SessionFactoryImpl:161 - building session factory
[java] 21:40:23,203 INFO SessionFactoryObjectFactory:82 - Not binding fact
ory to JNDI, no JNDI name configured
[java] 21:40:23,203 INFO SchemaExport:154 - Running hbm2ddl schema export
[java] 21:40:23,203 DEBUG SchemaExport:170 - import file not found: /import
.sql
[java] 21:40:23,203 INFO SchemaExport:179 - exporting generated schema to
database
[java] 21:40:23,203 DEBUG SchemaExport:303 - alter table PERSON_EMAIL_ADDR
drop foreign key FKA54215FE7708282F
[java] 21:40:23,203 DEBUG SchemaExport:288 - Unsuccessful: alter table PERS
ON_EMAIL_ADDR drop foreign key FKA54215FE7708282F
[java] 21:40:23,203 DEBUG SchemaExport:289 - Table not found: PERSON_EMAIL_
ADDR in statement [alter table PERSON_EMAIL_ADDR drop foreign key FKA54215FE7708
282F]
[java] 21:40:23,203 DEBUG SchemaExport:303 - alter table PERSON_EVENT drop
foreign key FKAD91D9107708282F
[java] 21:40:23,203 DEBUG SchemaExport:288 - Unsuccessful: alter table PERS
ON_EVENT drop foreign key FKAD91D9107708282F
[java] 21:40:23,203 DEBUG SchemaExport:289 - Table not found: PERSON_EVENT
in statement [alter table PERSON_EVENT drop foreign key FKAD91D9107708282F]
[java] 21:40:23,218 DEBUG SchemaExport:303 - alter table PERSON_EVENT drop
foreign key FKAD91D910F96D1A45
[java] 21:40:23,218 DEBUG SchemaExport:288 - Unsuccessful: alter table PERS
ON_EVENT drop foreign key FKAD91D910F96D1A45
[java] 21:40:23,218 DEBUG SchemaExport:289 - Table not found: PERSON_EVENT
in statement [alter table PERSON_EVENT drop foreign key FKAD91D910F96D1A45]
[java] 21:40:23,218 DEBUG SchemaExport:303 - drop table if exists EVENTS
[java] 21:40:23,218 DEBUG SchemaExport:288 - Unsuccessful: drop table if ex
ists EVENTS
[java] 21:40:23,218 DEBUG SchemaExport:289 - Table not found: IF in stateme
nt [drop table if exists EVENTS]
[java] 21:40:23,218 DEBUG SchemaExport:303 - drop table if exists PERSON
[java] 21:40:23,218 DEBUG SchemaExport:288 - Unsuccessful: drop table if ex
ists PERSON
[java] 21:40:23,218 DEBUG SchemaExport:289 - Table not found: IF in stateme
nt [drop table if exists PERSON]
[java] 21:40:23,218 DEBUG SchemaExport:303 - drop table if exists PERSON_EM
AIL_ADDR
[java] 21:40:23,218 DEBUG SchemaExport:288 - Unsuccessful: drop table if ex
ists PERSON_EMAIL_ADDR
[java] 21:40:23,218 DEBUG SchemaExport:289 - Table not found: IF in stateme
nt [drop table if exists PERSON_EMAIL_ADDR]
[java] 21:40:23,218 DEBUG SchemaExport:303 - drop table if exists PERSON_EV
ENT
[java] 21:40:23,218 DEBUG SchemaExport:288 - Unsuccessful: drop table if ex
ists PERSON_EVENT
[java] 21:40:23,218 DEBUG SchemaExport:289 - Table not found: IF in stateme
nt [drop table if exists PERSON_EVENT]
[java] 21:40:23,218 DEBUG SchemaExport:303 - create table EVENTS (EVENT_ID
bigint not null auto_increment, EVENT_DATE datetime, title varchar(255), primary
key (EVENT_ID))
[java] 21:40:23,218 ERROR SchemaExport:274 - Unsuccessful: create table EVE
NTS (EVENT_ID bigint not null auto_increment, EVENT_DATE datetime, title varchar
(255), primary key (EVENT_ID))
[java] 21:40:23,218 ERROR SchemaExport:275 - Unexpected token: AUTO_INCREME
NT in statement [create table EVENTS (EVENT_ID bigint not null auto_increment, E
VENT_DATE datetime, title varchar(255), primary key (EVENT_ID))]
[java] 21:40:23,218 DEBUG SchemaExport:303 - create table PERSON (PERSON_ID
bigint not null auto_increment, age integer, firstname varchar(255), lastname v
archar(255), primary key (PERSON_ID))
[java] 21:40:23,218 ERROR SchemaExport:274 - Unsuccessful: create table PER
SON (PERSON_ID bigint not null auto_increment, age integer, firstname varchar(25
5), lastname varchar(255), primary key (PERSON_ID))
[java] 21:40:23,218 ERROR SchemaExport:275 - Unexpected token: AUTO_INCREME
NT in statement [create table PERSON (PERSON_ID bigint not null auto_increment,
age integer, firstname varchar(255), lastname varchar(255), primary key (PERSON_
ID))]
[java] 21:40:23,218 DEBUG SchemaExport:303 - create table PERSON_EMAIL_ADDR
(PERSON_ID bigint not null, EMAIL_ADDR varchar(255))
[java] 21:40:23,234 DEBUG SchemaExport:303 - create table PERSON_EVENT (EVE
NT_ID bigint not null, PERSON_ID bigint not null, primary key (PERSON_ID, EVENT_
ID))
[java] 21:40:23,234 DEBUG SchemaExport:303 - alter table PERSON_EMAIL_ADDR
add index FKA54215FE7708282F (PERSON_ID), add constraint FKA54215FE7708282F fore
ign key (PERSON_ID) references PERSON (PERSON_ID)
[java] 21:40:23,234 ERROR SchemaExport:274 - Unsuccessful: alter table PERS
ON_EMAIL_ADDR add index FKA54215FE7708282F (PERSON_ID), add constraint FKA54215F
E7708282F foreign key (PERSON_ID) references PERSON (PERSON_ID)
[java] 21:40:23,234 ERROR SchemaExport:275 - Unexpected token: FKA54215FE77
08282F in statement [alter table PERSON_EMAIL_ADDR add index FKA54215FE7708282F
(PERSON_ID), add constraint FKA54215FE7708282F foreign key (PERSON_ID) reference
s PERSON (PERSON_ID)]
[java] 21:40:23,234 DEBUG SchemaExport:303 - alter table PERSON_EVENT add i
ndex FKAD91D9107708282F (PERSON_ID), add constraint FKAD91D9107708282F foreign k
ey (PERSON_ID) references PERSON (PERSON_ID)
[java] 21:40:23,234 ERROR SchemaExport:274 - Unsuccessful: alter table PERS
ON_EVENT add index FKAD91D9107708282F (PERSON_ID), add constraint FKAD91D9107708
282F foreign key (PERSON_ID) references PERSON (PERSON_ID)
[java] 21:40:23,234 ERROR SchemaExport:275 - Unexpected token: FKAD91D91077
08282F in statement [alter table PERSON_EVENT add index FKAD91D9107708282F (PERS
ON_ID), add constraint FKAD91D9107708282F foreign key (PERSON_ID) references PER
SON (PERSON_ID)]
[java] 21:40:23,234 DEBUG SchemaExport:303 - alter table PERSON_EVENT add i
ndex FKAD91D910F96D1A45 (EVENT_ID), add constraint FKAD91D910F96D1A45 foreign ke
y (EVENT_ID) references EVENTS (EVENT_ID)
[java] 21:40:23,234 ERROR SchemaExport:274 - Unsuccessful: alter table PERS
ON_EVENT add index FKAD91D910F96D1A45 (EVENT_ID), add constraint FKAD91D910F96D1
A45 foreign key (EVENT_ID) references EVENTS (EVENT_ID)
[java] 21:40:23,234 ERROR SchemaExport:275 - Unexpected token: FKAD91D910F9
6D1A45 in statement [alter table PERSON_EVENT add index FKAD91D910F96D1A45 (EVEN
T_ID), add constraint FKAD91D910F96D1A45 foreign key (EVENT_ID) references EVENT
S (EVENT_ID)]
[java] 21:40:23,234 INFO SchemaExport:196 - schema export complete
[java] Hibernate: insert into EVENTS (EVENT_DATE, title) values (?, ?)
[java] 21:40:23,437 WARN JDBCExceptionReporter:77 - SQL Error: -22, SQLSta
te: S0002
[java] 21:40:23,437 ERROR JDBCExceptionReporter:78 - Table not found: EVENT
S in statement [insert into EVENTS (EVENT_DATE, title) values ('2007-10-20 21:40
:22.265', 'My Event')]
[java] Exception in thread "main" org.hibernate.exception.SQLGrammarExcepti
on: could not insert: [events.Event]
[java] at org.hibernate.exception.SQLStateConverter.convert(SQLStateCon
verter.java:67)
[java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExcep
tionHelper.java:43)
[java] at org.hibernate.id.insert.AbstractSelectingDelegate.performInse
rt(AbstractSelectingDelegate.java:40)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.insert
(AbstractEntityPersister.java:2158)
[java] at org.hibernate.persister.entity.AbstractEntityPersister.insert
(AbstractEntityPersister.java:2638)
[java] at org.hibernate.action.EntityIdentityInsertAction.execute(Entit
yIdentityInsertAction.java:48)
[java] at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250
)
[java] at org.hibernate.event.def.AbstractSaveEventListener.performSave
OrReplicate(AbstractSaveEventListener.java:298)
[java] at org.hibernate.event.def.AbstractSaveEventListener.performSave
(AbstractSaveEventListener.java:181)
[java] at org.hibernate.event.def.AbstractSaveEventListener.saveWithGen
eratedId(AbstractSaveEventListener.java:107)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.save
WithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
[java] at org.hibernate.event.def.DefaultSaveEventListener.saveWithGene
ratedOrRequestedId(DefaultSaveEventListener.java:33)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.enti
tyIsTransient(DefaultSaveOrUpdateEventListener.java:172)
[java] at org.hibernate.event.def.DefaultSaveEventListener.performSaveO
rUpdate(DefaultSaveEventListener.java:27)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSa
veOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
[java] at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
[java] at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
[java] at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
sorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMet
hodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.hibernate.context.ThreadLocalSessionContext$TransactionPr
otectionWrapper.invoke(ThreadLocalSessionContext.java:301)
[java] at $Proxy0.save(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: java.sql.SQLException: Table not found: EVENTS in stateme
nt [insert into EVENTS (EVENT_DATE, title) values ('2007-10-20 21:40:22.265', 'M
y Event')]
[java] at org.hsqldb.Trace.getError(Unknown Source)
[java] at org.hsqldb.Result.<init>(Unknown Source)
[java] at org.hsqldb.jdbcConnection.executeHSQL(Unknown Source)
[java] at org.hsqldb.jdbcConnection.execute(Unknown Source)
[java] at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
[java] at org.hsqldb.jdbcStatement.executeUpdate(Unknown Source)
[java] at org.hsqldb.jdbcPreparedStatement.executeUpdate(Unknown Source
)
[java] at org.hibernate.id.insert.AbstractSelectingDelegate.performInse
rt(AbstractSelectingDelegate.java:33)
[java] ... 23 more
[java] HsqlStringBuffer init count: 0
[java] HsqlStringBuffer update count: 0
[java] HsqlStringBuffer append(char) count: 0
[java] HsqlStringBuffer append(String) count: 0
[java] HsqlStringBuffer waste count: 0
[java] HsqlStringBuffer toString count: 3
[java] HsqlArrayList init count: 1
[java] HsqlArrayList update count: 0
[java] HsqlHashMap init count: 3
[java] HsqlHashMap update count: 48
[java] 21:40:23,437 INFO DriverManagerConnectionProvider:147 - cleaning up
connection pool: jdbc:hsqldb:hsql://localhost
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 2 seconds
C:\eclipse\workspace\hibernate>
|