小编Ric*_* GZ的帖子

在Jhipster - Heroku中设置盆景弹性搜索

在部署到Heroku我的Jhipster应用程序后,我想使用云弹性搜索(Bonsai)和JHipster.盆景提供以下env变量:

$BONSAI_URL 
Run Code Online (Sandbox Code Playgroud)

如何在application-prod.yml中正确添加?我一直在阅读文档,并尝试将其设置为集群节点值和主机.但我有点失落.任何提示都非常受欢迎.

应用prod.yml

spring:
devtools:
    restart:
        enabled: false
    livereload:
        enabled: false
datasource:
    url: jdbc:mysql://localhost:3306/App?useUnicode=true&characterEncoding=utf8&useSSL=false
    name:
    username: root
    password:
    hikari:
        data-source-properties:
            cachePrepStmts: true
            prepStmtCacheSize: 250
            prepStmtCacheSqlLimit: 2048
            useServerPrepStmts: true
jpa:
    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
    database: MYSQL
    show_sql: false
    properties:
        hibernate.cache.use_second_level_cache: true
        hibernate.cache.use_query_cache: false
        hibernate.generate_statistics: false
        hibernate.cache.region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
data:
    elasticsearch:
        network:
            host: ${BONSAI_URL}
        cluster-name:  VLT
        cluster-nodes: localhost:9300
mail:
    host: smtp.sendgrid.net
    port: 587
    username: ${SENDGRID_USERNAME}
    password: ${SENDGRID_PASSWORD}
    protocol: smtp
    tls: false
    auth: true
    from: noreply@app.com

thymeleaf:
    cache: true

liquibase:
contexts: prod

server:
port: 8080 …
Run Code Online (Sandbox Code Playgroud)

spring heroku elasticsearch bonsai-elasticsearch jhipster

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

Spring data jpa left join fetch 和 where 子句

我的存储库中有以下查询:

\n\n
SELECT p FROM Project p JOIN p.users u WHERE u.login =:login\n
Run Code Online (Sandbox Code Playgroud)\n\n

用户和项目之间存在多对多关系。\n一切正常,它返回用户的项目,但我希望每个项目返回相应的用户集。

\n\n

更新:按照 mateuszlo 的建议尝试了以下操作:

\n\n
SELECT p FROM Project p JOIN FECTH p.users JOIN p.users u WHERE u.login =:login\n
Run Code Online (Sandbox Code Playgroud)\n\n

但现在我遇到了以下异常:

\n\n
nested exception is java.lang.IllegalArgumentException: Count query validation failed for method public abstract org.springframework.data.domain.Page com.example.app.repository.ProjectRepository.findAllByUserLo\xe2\x80\x8c\xe2\x80\x8bgin(java.lang.String\xe2\x80\x8c\xe2\x80\x8b,org.springframework\xe2\x80\x8c\xe2\x80\x8b.data.domain.Pageabl\xe2\x80\x8c\xe2\x80\x8be)! org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list\n
Run Code Online (Sandbox Code Playgroud)\n

java spring jpa spring-data-jpa

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