我试图用连接执行HQL删除..很快搜索后我发现我需要创建一个查询,就像这里建议的那样:
http://dasunhegoda.com/1093-you-cant-specify-target-table-table_name-for-update-in-from-clause/104/
这是我的查询:
dao.executeByHql(
"DELETE FROM FinalGradeResult e WHERE e.id IN "
+ "( SELECT id FROM "
+ "( SELECT x FROM FinalGradeResult x "
+ "where x.student.id = :studentId "
+ " AND x.classDiscipline IN " +
+ "(SELECT cd from ClassDiscipline cd "
+ " where cd.clazz.id = :clazzId ) ) as X )",
new HqlParameter("studentId", student.getId()),
new HqlParameter("clazzId", from.getId()));
Run Code Online (Sandbox Code Playgroud)
但我一直收到这个错误:
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token:( near line 1, column 94 [DELETE FROM xxxxxxxxxxxx.entity.FinalGradeResult e WHERE e.id IN ( …Run Code Online (Sandbox Code Playgroud) 我正在尝试在Android上运行react-native测试应用.
我让设备运行,并且反应原生运行:
Marco@Marco-PC MINGW64 /d/workspace/ReactNativeTest
$ react-native start
Run Code Online (Sandbox Code Playgroud)
但出于某种原因我执行时:
react-native run-android
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
(node:3868) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'message' of undefined
Run Code Online (Sandbox Code Playgroud)
请帮我设置这个环境?
编辑尝试遵循本指南:https://facebook.github.io/react-native/releases/next/docs/getting-started.html
编辑2根据要求,我发布了完整的堆栈:
:app:zipalignDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
:app:installDebug
Installing APK 'app-debug.apk' on 'emulator-5554 - 6.0'
Unable to install D:\workspace\ReactNativeTest\android\app\build\outputs\apk\app-debug.apk
com.android.ddmlib.InstallException: Failed to establish session
at com.android.ddmlib.Device.installPackages(Device.java:894)
at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:113)
at com.android.builder.testing.ConnectedDevice$installPackages$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.groovy:119)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown …Run Code Online (Sandbox Code Playgroud) 我的 MySQL 数据库中有一个表,它有一个日期列:
+-------------------+---------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+---------------+------+-----+---------+----------------+
| id | bigint(20) | NO | PRI | NULL | auto_increment |
| type | varchar(50) | NO | | NULL | |
| expiration | date | NO | | NULL | |
Run Code Online (Sandbox Code Playgroud)
我正在使用带有 JPA 的 MySQL 来保存日期。我有一个功能,用户可以选择一个最终的日期范围,它会得到所有的日期。
查看此代码(带有一堆 SYSO)以尝试查看发生了什么...
@Override
protected DateTime nextReference(DateTime reference) {
System.out.println("Reference: " + reference.toString("dd-MM-YYYY"));
DateTime plus = reference.plusMonths(1);
System.out.println("One month from now: " + …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用selectOneMenu创建一个简单的复合组件......这非常简单:
<cc:implementation>
<h:panelGrid columns="2">
<p:outputLabel for="#{cc.attrs.fieldId}" value="#{cc.attrs.fieldLabel}"/>
<p:selectOneMenu id="#{cc.attrs.fieldId}" required="#{cc.attrs.required}" converter="#{cc.attrs.converter}" value="#{cc.attrs.targetValue}">
<f:selectItem itemLabel="#{msg['label.selecione.item']}" itemValue="" />
<f:selectItems value="#{cc.attrs.listValue}"/>
</p:selectOneMenu>
</h:panelGrid>
</cc:implementation>
Run Code Online (Sandbox Code Playgroud)
所以,问题是我试图通过转换器!这是一个ENUM转换器(使用@FacesConverter(value ="tipoCampoConverter")注释扩展EnumConverter)
错误是:javax.el.ELException:无法将类型为java.lang.String的tipoCampoConverter转换为接口javax.faces.convert.Converter
**编辑:
一些额外的信息:
我尝试使用和不使用'type'声明属性:
<cc:attribute name="converter" required="true" type="javax.faces.convert.Converter"/>
Run Code Online (Sandbox Code Playgroud)
更多信息:INFO:启动Servlet引擎:Apache Tomcat/7.0.12 INFO:初始化Mojarra 2.1.10 INFO:在PrimeFaces上运行3.4.2 INFO:在PrimeFaces Extensions上运行0.6.1
:)
java ×2
mysql ×2
android ×1
date ×1
hibernate ×1
hql ×1
jodatime ×1
jpa ×1
jsf-2 ×1
primefaces ×1
react-native ×1
sql-delete ×1