第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

莫名其妙的報錯?。?!求解決

@Test
	public?void?testWhere1(){
		String?hql?=?"?from?Order?o?where?o.orderItems?is?not?empty?";
		Query?query?=?session.createQuery(hql);
		List<Order>?orders?=?query.list();
		
		for(Order?order?:?orders){
			System.out.println(order.getCustomer().getName());
			System.out.println(order.getAmount());
			System.out.println(order.getTradeDate());
		}
	}

提示我hql語句有問題,測試一直報錯!

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:2545)
	at?org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
	at?org.hibernate.loader.Loader.list(Loader.java:2271)
	at?org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)
	at?org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)
	at?org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
	at?org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
	at?org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
	at?com.imooc.model.OrderTest.testWhere1(OrderTest.java:21)
	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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at?org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at?org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at?org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at?org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at?org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
	at?org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at?org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at?org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at?org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at?org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at?org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at?org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at?org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at?org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at?org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at?org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at?org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at?org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at?org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at?org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
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?order0_?where?exists?(select?orderitems1_.ID?from?ORDERITEM?orderitems1_?w'?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:406)
	at?com.mysql.jdbc.Util.getInstance(Util.java:381)
	at?com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1030)
	at?com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
	at?com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
	at?com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
	at?com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
	at?com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
	at?com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
	at?com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
	at?com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1885)
	at?org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
	at?org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
	at?org.hibernate.loader.Loader.doQuery(Loader.java:802)
	at?org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
	at?org.hibernate.loader.Loader.doList(Loader.java:2542)
	...?33?more


正在回答

2 回答

好像是映射文件里面 Item類和itemform表映射不對

0 回復(fù) 有任何疑惑可以回復(fù)我~

我的也是啊

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Catalina7 提問者

我解決了,我的問題是映射文件出錯了
2018-03-13 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

莫名其妙的報錯?。?!求解決

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號