数据核错误的批量更新

时间:2012-08-13 21:01:32

标签: datanucleus jdoql

我试图在datanucleus中使用JDOQL批量更新,但是我得到以下异常,

12/08/13 13:06:56 INFO DataNucleus.Persistence:属性datanucleus.cache.level2 unknown - 将被忽略 12/08/13 13:06:56 INFO DataNucleus.Persistence:=================持久性配置=============== 12/08/13 13:06:56 INFO DataNucleus.Persistence:DataNucleus Persistence Factory - 供应商:" DataNucleus"版本:" 2.2.5" 12/08/13 13:06:56 INFO DataNucleus.Persistence:DataNucleus Persistence Factory初始化数据存储区URL =" jdbc:derby :; databaseName = metastore_db; create = true"驾驶员=" org.apache.derby.jdbc.EmbeddedDriver"的userName =" APP" 12/08/13 13:06:56 INFO DataNucleus.Persistence:=================================== ======================== 12/08/13 13:06:57 INFO Datastore.Schema:初始化目录"",Schema" APP"使用"无"自动启动选项 12/08/13 13:06:57 INFO Datastore.Schema:Catalog"",Schema" APP"初始化 - 管理0个班级 12/08/13 13:06:57 INFO DataNucleus.MetaData:注册元数据初始化的监听器

要执行的查询:UPDATE myDomain.MTable t SET t.tableName =' tmp3'在哪里t.tableName ==' tmp' 12/08/13 13:06:57 INFO DataNucleus.JDO:抛出异常 JPQL UPDATE查询没有更新子句!查询应该像" UPDATE实体e SET e.param = new_value WHERE [where-clause]" org.datanucleus.exceptions.NucleusUserException:JPQL UPDATE查询没有更新子句!查询应该像" UPDATE实体e SET e.param = new_value WHERE [where-clause]"     at org.datanucleus.query.JDOQLSingleStringParser $ Compiler.compileUpdate(JDOQLSingleStringParser.java:236)     at org.datanucleus.query.JDOQLSingleStringParser $ Compiler.compileSelect(JDOQLSingleStringParser.java:160)     在org.datanucleus.query.JDOQLSingleStringParser $ Compiler.compile(JDOQLSingleStringParser.java:125)     at org.datanucleus.query.JDOQLSingleStringParser $ Compiler.access $ 000(JDOQLSingleStringParser.java:114)     at org.datanucleus.query.JDOQLSingleStringParser.parse(JDOQLSingleStringParser.java:106)     在org.datanucleus.store.query.AbstractJDOQLQuery。(AbstractJDOQLQuery.java:108)     在org.datanucleus.store.rdbms.query.JDOQLQuery。(JDOQLQuery.java:119)     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)     at org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:597)     at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:324)     在org.datanucleus.store.query.QueryManager.newQuery(QueryManager.java:264)     在org.datanucleus.jdo.JDOPersistenceManager.newQuery(JDOPersistenceManager.java:1272)

我使用的是DN-core-2.2.4,DN-RDBMS-2.2.4,DN-Enhancer-2.1.3和DN-ConnectionPool-2.0.3。

我触发更新的代码段如下,

openTransaction();
Query q = pm.newQuery("javax.jdo.query.JDOQL", query);
q.compile();
Collection<?> result = (Collection<?>) q.execute();
committed = commitTransaction();

关于我做错了什么的任何指示。

我的查询格式为&#34; UPDATE myDomain.A t SET t.tableName =&#39; tmp3&#39;在哪里t.tableName ==&#39; tmp&#39;&#34;

0 个答案:

没有答案