Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.5
Full stack trace of any exception that occurs:
[java] 15:33:57,617 DEBUG SchemaExport:161 - create table AuctionItem (
[java] id bigint not null auto_increment,
[java] seller bigint not null,
[java] description varchar(200) not null,
[java] ends datetime,
[java] condition integer,
[java] successfulBid bigint,
[java] primary key (id),
[java] unique (seller, description)
[java] ) comment 'An item that is being auctioned.' type=MyISAM
[java] 15:33:57,617 ERROR SchemaExport:167 - Unsuccessful: create table AuctionItem (id bigint not null auto_increment, seller bigint not null, description varchar(200) not null, ends datetime, condition integer, successfulBid bigint, primary key (id), unique (seller, description)) comment 'An item that is being auctioned.' type=MyISAM
[java] 15:33:57,617 ERROR SchemaExport:168 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition integer, successfulBid bigint, primary key (id), unique (seller, descr' at line 1
[java] 15:33:57,617 DEBUG SchemaExport:161 - create table AuctionUser (
[java] id bigint not null auto_increment,
[java] userName varchar(10) not null,
[java] `password` varchar(15) not null,
[java] email varchar(255),
[java] firstName varchar(50) not null,
[java] `initial` char(1),
[java] lastName varchar(50) not null,
[java] primary key (id),
[java] unique (userName)
[java] ) comment 'Users may bid for or sell auction items.' type=MyISAM
[java] 15:33:57,633 DEBUG SchemaExport:161 - create table Bid (
[java] id bigint not null auto_increment,
[java] isBuyNow char(1) not null comment 'Y if a "buy now", N if a regular bid.',
[java] item bigint not null,
[java] amount float not null,
[java] `datetime` datetime not null,
[java] bidder bigint not null,
[java] primary key (id),
[java] unique (item, amount)
[java] ) comment 'A bid or "buy now" for an item.' type=MyISAM
[java] 15:33:57,633 DEBUG SchemaExport:161 - alter table AuctionItem
[java] add index FK522A9BD61107FE9B (seller),
[java] add constraint FK522A9BD61107FE9B
[java] foreign key (seller)
[java] references AuctionUser (id)
[java] 15:33:57,633 ERROR SchemaExport:167 - Unsuccessful: alter table AuctionItem add index FK522A9BD61107FE9B (seller), add constraint FK522A9BD61107FE9B foreign key (seller) references AuctionUser (id)
[java] 15:33:57,633 ERROR SchemaExport:168 - Table 'test3.AuctionItem' doesn't exist
[java] 15:33:57,633 DEBUG SchemaExport:161 - alter table AuctionItem
[java] add index FK522A9BD6F65B1FAF (successfulBid),
[java] add constraint FK522A9BD6F65B1FAF
[java] foreign key (successfulBid)
[java] references Bid (id)
[java] 15:33:57,648 ERROR SchemaExport:167 - Unsuccessful: alter table AuctionItem add index FK522A9BD6F65B1FAF (successfulBid), add constraint FK522A9BD6F65B1FAF foreign key (successfulBid) references Bid (id)
[java] 15:33:57,648 ERROR SchemaExport:168 - Table 'test3.AuctionItem' doesn't exist
[java] 15:33:57,648 DEBUG SchemaExport:161 - alter table Bid
[java] add index FK104DDEE6E7E98 (item),
[java] add constraint FK104DDEE6E7E98
[java] foreign key (item)
[java] references AuctionItem (id)
[java] 15:33:57,648 DEBUG SchemaExport:161 - alter table Bid
[java] add index FK104DDF43A3910 (bidder),
[java] add constraint FK104DDF43A3910
[java] foreign key (bidder)
[java] references AuctionUser (id)
[java] 15:33:57,664 INFO SchemaExport:173 - schema export complete
[java] 15:33:57,664 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:mysql://130.48.64.233:3306/test3
[java] 15:33:57,664 INFO SessionFactoryImpl:379 - Checking 0 named queries
[java] Setting up some test data
[java] 15:33:57,820 WARN JDBCExceptionReporter:71 - SQL Error: 1064, SQLState: 42000
[java] 15:33:57,836 ERROR JDBCExceptionReporter:72 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition, successfulBid) values (1, 'auction item 0', '2005-08-17 15:33:57', 2,' at line 1
[java] Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not insert: [org.hibernate.auction.AuctionItem]
[java] at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)
[java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
[java] at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1777)
[java] at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2178)
[java] at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:34)
[java] at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
[java] at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:240)
[java] at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:160)
[java] at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:95)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:184)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:173)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:96)
[java] at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:69)
[java] at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:468)
[java] at org.hibernate.engine.Cascades$5.cascade(Cascades.java:154)
[java] at org.hibernate.engine.Cascades.cascadeAssociation(Cascades.java:771)
[java] at org.hibernate.engine.Cascades.cascade(Cascades.java:720)
[java] at org.hibernate.engine.Cascades.cascadeCollection(Cascades.java:895)
[java] at org.hibernate.engine.Cascades.cascadeAssociation(Cascades.java:792)
[java] at org.hibernate.engine.Cascades.cascade(Cascades.java:720)
[java] at org.hibernate.engine.Cascades.cascade(Cascades.java:847)
[java] at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:121)
[java] at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:112)
[java] at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:59)
[java] at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
[java] at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
[java] at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:324)
[java] at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
[java] at org.hibernate.auction.Main.createTestAuctions(Main.java:348)
[java] at org.hibernate.auction.Main.main(Main.java:369)
[java] Caused by: java.sql.SQLException: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'condition, successfulBid) values (1, 'auction item 0', '2005-08-17 15:33:57', 2,' at line 1
[java] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2847)
[java] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1531)
[java] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1622)
[java] at com.mysql.jdbc.Connection.execSQL(Connection.java:2376)
[java] at com.mysql.jdbc.Connection.execSQL(Connection.java:2297)
[java] at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1860)
[java] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1957)
[java] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1880)
[java] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1741)
[java] at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1759)
[java] ... 27 more
Name and version of the database you are using: mysql 5.0.10beta
Bonjour à tous, je suis nouveau à l'utilisation d'hibernate et pour ce faire je voulais tester l'exemple de base donc j'ai copié les fichiers dans les différents repertoire ensuite jai fais un ant build puis ant eg et j'obtient cette erreur.
Pouvez vous m'aider svp ?
merci bcp