Hi, I am trying to use JBoss Hibernate Tools for reverse engineering. I use eclipse luna and the latest hibernate jboss tools in the eclipse market. When I try to configure the hibernate tools configuration, after completing the setup, when I expand the tree and expand the database node, it generates the following error:
<Reading Schema Error: Could not get list of suggested identity strategies from database. Probably a JDBC Driver Problem>
Stack trace:
org.hibernate.exception.SQLGrammarException: Could not get list of suggested identity strategies from database. Probably a JDBC driver problem. at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92) at org.hibernate.cfg.reveng.dialect.MySQLMetaDataDialect.getSuggestedPrimaryKeyStrategyName(MySQLMetaDataDialect.java:55) at org.hibernate.cfg.reveng.JDBCReader.processPrimaryKey(JDBCReader.java:429) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:86) at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$2.execute(LazyDatabaseSchemaWorkbenchAdapter.java:126) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107) at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:115) at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:65) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:238) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '-empirecl-test like 'oauth_access_token'' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:408) at com.mysql.jdbc.Util.getInstance(Util.java:383) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158)
My connection to the database with eclipse is successfully done using Database explore using eclipse so that the connection is successful and also displays all the tables. I am using Hibernate 4.3 and the latest MySQL driver 5.1.31 . Below are screenshots of my configuration.
Below is my hibernate.cfg.xml file:
<hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.password">password</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/nit-empirecl-test</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> </session-factory> </hibernate-configuration>
source share