小编hab*_*713的帖子

CteInsertStrategy 只能与支持 CTE 且也可以采用 UPDATE 或 DELETE 语句的方言一起使用

带有 PostgreSQL JDBC 驱动程序 42.3.5 的 Hibernate 6.0.1 会导致以下异常:

java.lang.UnsupportedOperationException:
CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements as well
at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:123)
at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:107)
at org.hibernate.dialect.PostgreSQLDialect.getFallbackSqmInsertStrategy(PostgreSQLDialect.java:704)
...
Run Code Online (Sandbox Code Playgroud)

出了什么问题以及如何解决该问题?

MyEntity.java

java.lang.UnsupportedOperationException:
CteInsertStrategy can only be used with Dialects that support CTE that can take UPDATE or DELETE statements as well
at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:123)
at org.hibernate.query.sqm.mutation.internal.cte.CteInsertStrategy.<init>(CteInsertStrategy.java:107)
at org.hibernate.dialect.PostgreSQLDialect.getFallbackSqmInsertStrategy(PostgreSQLDialect.java:704)
...
Run Code Online (Sandbox Code Playgroud)

MyTest.java

import jakarta.persistence.*;

@Entity
@Table(name = "my_entity")
public class MyEntity {

    private Long id;

    @Id …
Run Code Online (Sandbox Code Playgroud)

java postgresql hibernate jpa common-table-expression

8
推荐指数
1
解决办法
5292
查看次数

设置cookie时总是中断JavaScript执行

设置cookie(不显式设置JS断点)时,是否总是有可能中断FireBug(或其他Web开发工具)中的javascript执行?

document.cookie = '...';
Run Code Online (Sandbox Code Playgroud)

哈里

javascript cookies firebug web-developer-toolbar

5
推荐指数
2
解决办法
3088
查看次数

使用 AWK 选择输入记录字段

假设我们有一个 shell 变量,$x其中包含一个以空格分隔的 1 到 30 数字列表:

$ x=$(for i in {1..30}; do echo -n "$i "; done)
$ echo $x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
Run Code Online (Sandbox Code Playgroud)

我们可以像这样用 AWK 打印前三个输入记录字段:

$ echo $x | awk '{print $1 " " $2 " " $3}'
1 2 3
Run Code Online (Sandbox Code Playgroud)

我们如何使用 AWK 打印从第 N 个字段开始的所有字段?例如

4 5 6 …
Run Code Online (Sandbox Code Playgroud)

arrays awk

4
推荐指数
1
解决办法
76
查看次数

对 WildFly 10 配置的永久更改 (standalone.xml)

如何使这两项 Wildfly 10 配置更改永久生效?

  • 最大参数=“4000”
  • <访问日志/>

如果我将它们写入standalone.xml并重新启动Wildfly,它们就会消失。

<subsystem xmlns="urn:jboss:domain:undertow:3.1">
  <buffer-cache name="default"/>
  <server name="default-server">
    <http-listener name="default" socket-binding="http" redirect-socket="https" max-parameters="4000" />
    <host name="default-host" alias="localhost">
      <location name="/" handler="welcome-content"/>
      <access-log/>
      <filter-ref name="server-header"/>
      <filter-ref name="x-powered-by-header"/>
    </host>
  </server>
...
Run Code Online (Sandbox Code Playgroud)

哈里

configuration jboss wildfly wildfly-10

2
推荐指数
1
解决办法
1170
查看次数

构建 Liferay 主题失败并出现错误“找不到模块‘liferay-font-awesome’”

构建 Liferay 主题失败并出现错误Cannot find module 'liferay-font-awesome'。出了什么问题以及如何解决该问题?

$ mkdir liferay-workspace
$ cd liferay-workspace/
$ blade init --liferay-version portal-7.4-ga6
$ blade server init
$ cd themes/
$ yo liferay-theme # Would you like to add Font Awesome to your theme? Yes
$ cd my-liferay-theme/
$ gulp build
[18:55:39] Error: Cannot find module 'liferay-font-awesome'
$ npm i liferay-font-awesome
$ gulp build
[18:58:33] Error: Cannot find module 'liferay-font-awesome'
Run Code Online (Sandbox Code Playgroud)

版本信息

$ npm -v 
6.14.12
$ blade version
blade version 4.0.10.202111191310
$ gulp -v …
Run Code Online (Sandbox Code Playgroud)

liferay liferay-theme font-awesome yeoman gulp

2
推荐指数
1
解决办法
692
查看次数

无法编译 Crow 示例 - boost/optional.hpp:没有这样的文件或目录

我想在 Debian Linux 11 中编译和测试 Crow C++ 微框架:

  1. 下载最新的crow.deb,目前是crow-v1.0+1.deb

  2. 安装它:

    $ sudo dpkg -i crow-v1.0+1.deb
    Selecting previously unselected package crow.
    (Reading database ... 587955 files and directories currently installed.)
    Preparing to unpack crow-v1.0+1.deb ...
    Unpacking crow (1.0+1) ...
    Setting up crow (1.0+1) ...
    
    Run Code Online (Sandbox Code Playgroud)
  3. 使用crowcpp.org.cpp中的示例代码创建一个文件:

    $ echo '#include "crow.h"
    
    int main()
    {
        crow::SimpleApp app;
    
        CROW_ROUTE(app, "/")([](){
            return "Hello world";
        });
    
        app.port(18080).run();
    }' > crowtest.cpp
    
    Run Code Online (Sandbox Code Playgroud)
  4. 尝试编译它:

    $ g++ crowtest.cpp -lpthread
     In file included from /usr/include/crow.h:2,
                      from …
    Run Code Online (Sandbox Code Playgroud)

c++ g++ file-not-found crow

2
推荐指数
1
解决办法
1695
查看次数