I am using Hibernate Tool 3.0 alpha1 on Eclipse 3.1M5 to reverse engineer our database which is Progress Open Edge 10. We use hypen's in the table and field names within our database.
The generation of mapping files and java classes worked fine. However, in the HQL editor, whenever a query referenced a field or table which has a hypen in the underlying Progress database, I got the following error :-
SQLGrammarException:could not execute query.
The reverse engineering removed the hypen's from the names when creating the java classes. The mapping files seem to indicate that everything is handled properly. The following is a section of the mapping file generated automatically, indicating that the database field branch-num is mapped to the java field name BranchNum:-
<id
name="BranchNum"
type="java.lang.Integer"
>
<column name="branch-num" length="10" not-null="false" unique="true" sql-type="integer" />
<generator class="assigned" />
</id>
Any help would be much apprecipated.
Regards
Kay Chee Cheung
P.S. The following is the error log as recorded by the Eclipse Workbench
!ENTRY org.hibernate.eclipse.console.HibernateConsolePlugin 4 4 2005-04-01 18:15:01.140
!MESSAGE Exception while executing HQL Query
!SUBENTRY 1 org.hibernate.eclipse.console.HibernateConsolePlugin 4 4 2005-04-01 18:15:01.140
!MESSAGE could not execute query
!STACK 0
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:59)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1363)
at org.hibernate.loader.Loader.list(Loader.java:1343)
at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:872)
at org.hibernate.impl.SessionImpl.find(SessionImpl.java:973)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:30)
at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:74)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:766)
at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1030)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:708)
at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:823)
at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:756)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:710)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:699)
at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1172)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1109)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1170)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1129)
at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:660)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1323)
at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:168)
at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:147)
at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:105)
at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:78)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:47)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:52)
at javax.swing.AbstractListModel.fireIntervalAdded(Unknown Source)
at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
at org.hibernate.console.KnownConfigurations$3.queryPageCreated(KnownConfigurations.java:167)
at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:265)
at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:246)
at org.hibernate.eclipse.console.actions.ExecuteHQLAction.execute(ExecuteHQLAction.java:99)
at org.hibernate.eclipse.console.actions.ExecuteHQLAction.run(ExecuteHQLAction.java:94)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:1003)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:557)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:507)
at org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:462)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2908)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2541)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1612)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1578)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:293)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:333)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:150)
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 org.eclipse.core.launcher.Main.invokeFramework(Main.java:268)
at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
at org.eclipse.core.launcher.Main.run(Main.java:887)
at org.eclipse.core.launcher.Main.main(Main.java:871)
Caused by: java.sql.SQLException: [JDBC OpenEdge Driver]:Column not found/specified (7520)
at com.progress.sql.jdbc.JdbcProgress.createSQLException(JdbcProgress.java:6562)
at com.progress.sql.jdbc.JdbcProgress.standardError(JdbcProgress.java:6736)
at com.progress.sql.jdbc.JdbcProgress.SQLUTFPrepare(JdbcProgress.java:4557)
at com.progress.sql.jdbc.JdbcProgressConnection.prepareStatement(JdbcProgressConnection.java:499)
at com.progress.sql.jdbc.JdbcProgressConnection.prepareStatement(JdbcProgressConnection.java:466)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:356)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:307)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:86)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1016)
at org.hibernate.loader.Loader.doQuery(Loader.java:348)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:195)
at org.hibernate.loader.Loader.doList(Loader.java:1360)
... 57 more
!SUBENTRY 2 org.hibernate.eclipse.console.HibernateConsolePlugin 4 150 2005-04-01 18:15:01.140
!MESSAGE could not execute query
!STACK 0
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:59)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1363)
at org.hibernate.loader.Loader.list(Loader.java:1343)
at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:872)
at org.hibernate.impl.SessionImpl.find(SessionImpl.java:973)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:30)
at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:74)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:766)
at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1030)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:708)
at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:823)
at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:756)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:710)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:699)
at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1172)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1109)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1170)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1129)
at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:660)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1323)
at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:168)
at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:147)
at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:105)
at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:78)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:47)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:52)
at javax.swing.AbstractListModel.fireIntervalAdded(Unknown Source)
at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
at org.hibernate.console.KnownConfigurations$3.queryPageCreated(KnownConfigurations.java:167)
at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:265)
at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:246)
at org.hibernate.eclipse.console.actions.ExecuteHQLAction.execute(ExecuteHQLAction.java:99)
at org.hibernate.eclipse.console.actions.ExecuteHQLAction.run(ExecuteHQLAction.java:94)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:1003)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:557)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:507)
at org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:462)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2908)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2541)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1612)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1578)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:293)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:333)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:150)
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 org.eclipse.core.launcher.Main.invokeFramework(Main.java:268)
at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
at org.eclipse.core.launcher.Main.run(Main.java:887)
at org.eclipse.core.launcher.Main.main(Main.java:871)
Caused by: java.sql.SQLException: [JDBC OpenEdge Driver]:Column not found/specified (7520)
at com.progress.sql.jdbc.JdbcProgress.createSQLException(JdbcProgress.java:6562)
at com.progress.sql.jdbc.JdbcProgress.standardError(JdbcProgress.java:6736)
at com.progress.sql.jdbc.JdbcProgress.SQLUTFPrepare(JdbcProgress.java:4557)
at com.progress.sql.jdbc.JdbcProgressConnection.prepareStatement(JdbcProgressConnection.java:499)
at com.progress.sql.jdbc.JdbcProgressConnection.prepareStatement(JdbcProgressConnection.java:466)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:356)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:307)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:86)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1016)
at org.hibernate.loader.Loader.doQuery(Loader.java:348)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:195)
at org.hibernate.loader.Loader.doList(Loader.java:1360)
... 57 more
!SUBENTRY 2 org.hibernate.eclipse.console.HibernateConsolePlugin 4 150 2005-04-01 18:15:01.156
!MESSAGE [JDBC OpenEdge Driver]:Column not found/specified (7520)
!STACK 0
java.sql.SQLException: [JDBC OpenEdge Driver]:Column not found/specified (7520)
at com.progress.sql.jdbc.JdbcProgress.createSQLException(JdbcProgress.java:6562)
at com.progress.sql.jdbc.JdbcProgress.standardError(JdbcProgress.java:6736)
at com.progress.sql.jdbc.JdbcProgress.SQLUTFPrepare(JdbcProgress.java:4557)
at com.progress.sql.jdbc.JdbcProgressConnection.prepareStatement(JdbcProgressConnection.java:499)
at com.progress.sql.jdbc.JdbcProgressConnection.prepareStatement(JdbcProgressConnection.java:466)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:356)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:307)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:86)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1016)
at org.hibernate.loader.Loader.doQuery(Loader.java:348)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:195)
at org.hibernate.loader.Loader.doList(Loader.java:1360)
at org.hibernate.loader.Loader.list(Loader.java:1343)
at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:872)
at org.hibernate.impl.SessionImpl.find(SessionImpl.java:973)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:30)
at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:74)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:766)
at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1030)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:708)
at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:823)
at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:756)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:710)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:699)
at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1172)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1109)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1170)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1129)
at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:660)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1323)
at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:168)
at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:147)
at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:105)
at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:78)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:47)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:52)
at javax.swing.AbstractListModel.fireIntervalAdded(Unknown Source)
at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
at org.hibernate.console.KnownConfigurations$3.queryPageCreated(KnownConfigurations.java:167)
at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:265)
at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:246)
at org.hibernate.eclipse.console.actions.ExecuteHQLAction.execute(ExecuteHQLAction.java:99)
at org.hibernate.eclipse.console.actions.ExecuteHQLAction.run(ExecuteHQLAction.java:94)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:1003)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:557)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:507)
at org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:462)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2908)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2541)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1612)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1578)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:293)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:333)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:150)
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 org.eclipse.core.launcher.Main.invokeFramework(Main.java:268)
at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
at org.eclipse.core.launcher.Main.run(Main.java:887)
at org.eclipse.core.launcher.Main.main(Main.java:871)
|