将application.properties转换为application.yml春季启动

时间:2018-11-25 04:23:16

标签: hibernate spring-boot yaml

我正在使用bootstrap.properties来访问我在github中拥有的设置。 我在/ sources中有一个带data.sql文件的postgres数据库,该数据库将一些条目插入数据库。 如果我在github中使用以下配置使用application.properties文件:

spring:
  profiles.actives: development
  jpa: 
    properties:
      hibernate:
        formatSql: true
        jdbc:
          lob:
            non-contextual-creation: true
    databasePlatform: org.hibernate.dialect.PostgreSQL9Dialect
    show-sql: false 
    hibernate: 
      ddlAuto: create-drop 
      naming:
        implicitStrategy: org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
  datasource: 
    platform: postgres 
    url: jdbc:postgresql://localhost:5432/zeus 
    username: postgres 
    password: postgres 
    driverClassName: org.postgresql.Driver
    initialization-mode: always

工作。

但是,如果我使用具有以下配置的applicaition.yml:

SELECT     [Mobile Number]

,sum(CASE WHEN Adjustment_Code = 'CRE' then COALESCE ([Adjustment_Amount], 0)else 0 END) as "Total Amount Borrowed",
sum(CASE WHEN Adjustment_Code = 'DEB' then COALESCE(abs([Adjustment_Amount]), 0)else 0  END) as "Total Amount Payback"

,COUNT(CASE WHEN Adjustment_Code = 'CRE' THEN 1 ELSE NULL END) AS [Total TRX Borrowed]
,COUNT(CASE WHEN Adjustment_Code = 'DEB' THEN 1 ELSE NULL END) AS [Total TRX Payback]

, (select LEAD(Full_Date, 5, 0) OVER (PARTITION By adjustment_code ORDER BY date_key) AS Lead_2

from [Adjustment Transaction] )


FROM dbo.[Adjustment Transaction] INNER JOIN dbo.[Time Day Lookup] ON dbo.[Adjustment Transaction].Date_Key = dbo.[Time Day Lookup].Date_Key


group by [Mobile Number],Full_Date

未输入任何信息。 有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

需要为application.yml添加双引号

例如:

spring:
  profiles.actives: "development"
  jpa: 
    properties:
      hibernate:
        formatSql: true
        jdbc:
          lob:
            non-contextual-creation: true
    databasePlatform: "org.hibernate.dialect.PostgreSQL9Dialect"
    show-sql: false 

yaml syntax documentation