在部署到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) 我的存储库中有以下查询:
\n\nSELECT p FROM Project p JOIN p.users u WHERE u.login =:login\nRun Code Online (Sandbox Code Playgroud)\n\n用户和项目之间存在多对多关系。\n一切正常,它返回用户的项目,但我希望每个项目返回相应的用户集。
\n\n更新:按照 mateuszlo 的建议尝试了以下操作:
\n\nSELECT p FROM Project p JOIN FECTH p.users JOIN p.users u WHERE u.login =:login\nRun Code Online (Sandbox Code Playgroud)\n\n但现在我遇到了以下异常:
\n\nnested 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\nRun Code Online (Sandbox Code Playgroud)\n