SQL Grammar Fehler

TJava

Bekanntes Mitglied
Hallo,

ich habe einen Tabelle um eine Spalte erweitert. Ich kann alle Tabellen abfragen außer dieses einen.
Das Mapping habe ich erneuert usw.
Ich arbeite mit Hibernate-Tools und habe mir das Mapping und die Klassen generieren lassen.

Woran kann das liegen?



Java:
eclipse.buildId=I20100608-0911
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product


Error
Wed Jul 27 15:42:05 CEST 2011
Exception while executing HQL Query

Java:
Error
Wed Jul 27 15:42:05 CEST 2011
org.hibernate.exception.SQLGrammarException: could not execute query

org.hibernate.exception.SQLGrammarException: could not execute query
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
	at org.hibernate.loader.Loader.doList(Loader.java:2452)
	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2192)
	at org.hibernate.loader.Loader.list(Loader.java:2187)
	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452)
	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
	at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:50)
	at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:120)
	at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:989)
	at org.eclipse.jface.viewers.ColumnViewer.getRawChildren(ColumnViewer.java:703)
	at org.eclipse.jface.viewers.AbstractTableViewer.getRawChildren(AbstractTableViewer.java:1087)
	at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:896)
	at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:1046)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java:701)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:649)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:636)
	at org.eclipse.jface.viewers.AbstractTableViewer$2.run(AbstractTableViewer.java:592)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1422)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1383)
	at org.eclipse.jface.viewers.AbstractTableViewer.inputChanged(AbstractTableViewer.java:590)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:274)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1664)
	at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:225)
	at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:203)
	at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:160)
	at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:109)
	at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:75)
	at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:85)
	at javax.swing.AbstractListModel.fireIntervalAdded(Unknown Source)
	at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:67)
	at org.hibernate.console.KnownConfigurations$1.queryPageCreated(KnownConfigurations.java:88)
	at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:308)
	at org.hibernate.console.ConsoleConfiguration.access$4(ConsoleConfiguration.java:306)
	at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:268)
	at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
	at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:72)
	at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:261)
	at org.hibernate.eclipse.hqleditor.HQLEditor.executeQuery(HQLEditor.java:449)
	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:84)
	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:55)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:59)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
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 'Order as Order12_ from foxtrot.test_suite_test_case testsuitet0_' 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:407)
	at com.mysql.jdbc.Util.getInstance(Util.java:382)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2273)
	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
	at org.hibernate.loader.Loader.getResultSet(Loader.java:1869)
	at org.hibernate.loader.Loader.doQuery(Loader.java:718)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
	at org.hibernate.loader.Loader.doList(Loader.java:2449)
	... 70 more
 
S

SlaterB

Gast
dir kommt nicht in Sinn, die SQL-Tabelle, das Mapping dazu, die Java-Klasse, besonders die neuesten Änderungen oder irgendeine Art von offensichtlich hilfreicher Information konkret zum Fehler zur Verfügung zu stellen?
die eclipse.buildId wird wohl nicht der Grund sein warum nach einer Änderung von dir etwas nicht mehr geht

die einzige Information aus der Fehlermeldung darf man auch noch selber ausgraben:
> 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
> 'Order as Order12_ from foxtrot.test_suite_test_case testsuitet0_' at line 1

sieht so aus als würde ein Mapping oder eine SQL-Tabellenattribut Order heißen,
das ist natürlich übel wenn man bedenkt dass ORDER BY wesentliche SQL-Syntax ist,
Schlüsselwörter nicht verwenden
 

TJava

Bekanntes Mitglied
SO eine sch*****

:-D

Ich bin Anfänger und diese Vorgabe kam von meinem Chef :-D

Da hat er mir mal schön ein Bein gestellt, aber bin auch Dumm.
Ich habe mich noch gefragt wieso Order gehighlighted ist :-D;(;(;(
Wieder mal viel Zeit verschwendet...

Danke:applaus:
 

Ähnliche Java Themen


Oben