小编Lou*_*uis的帖子

如何解决“无法执行语句;SQL [n/a];嵌套异常是 org.hibernate.exception.SQLGrammarException:无法执行语句”?

如何解决“无法执行语句;SQL [n/a];嵌套异常是 org.hibernate.exception.SQLGrammarException:无法执行语句”?

我在运行我的应用程序时遇到了这样的错误。我分享我的代码片段相关服务和存储库。当我更改评论和帖子的报告状态时,我会得到成功和失败的对比结果。

配置的yaml文件如下。

 jpa:
    open-in-view: false
    database: MYSQL
    generate-ddl: true
    show-sql: true
    hibernate:
      ddl-auto: update
      naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy

    properties:
      hibernate:
        use-new-id-generator-mappings: false
        enable_lazy_load_no_trans: true
        format_sql: true
        use_sql_comments: true
        dialect: org.hibernate.dialect.MySQL5InnoDBDialect
#       dialect: org.hibernate.spatial.dialect.mysql.MySQL5SpatialDialect
        default_batch_fetch_size: 100
        search:
          autoregister_listeners: false
          indexing_strategy: manual
          default:
            indexmanager: elasticsearch   #5.6.16
          elasticsearch:
            host: http://localhost:9200
              index_schema_management_strategy: update   #update
              #username: user
              #password: password
              log:
                json_pretty_printing: true
              required_index_status: yellow
              dynamic_mapping: true
              update_all_types: true
Run Code Online (Sandbox Code Playgroud)
// RestAdminReportController //

    @JsonView(Views.WebAdminJsonView.class)
  @PostMapping(path = "/{id}/changeStatus")
  public ResponseEntity<Map<String, Object>> changeStatus(@PathVariable long id, @RequestParam ReportStatus reportStatus, …
Run Code Online (Sandbox Code Playgroud)

java spring hibernate spring-data-jpa

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

标签 统计

hibernate ×1

java ×1

spring ×1

spring-data-jpa ×1