Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java MariaDB查询中没有这样的列:id_Java_Spring_Spring Boot_Jpa_Spring Data Jpa - Fatal编程技术网

Java MariaDB查询中没有这样的列:id

Java MariaDB查询中没有这样的列:id,java,spring,spring-boot,jpa,spring-data-jpa,Java,Spring,Spring Boot,Jpa,Spring Data Jpa,我在JPA存储库中有此查询: @Repository public interface PaymentTransactionsDailyFactsRepository extends JpaRepository<PaymentTransactionsDailyFacts, Integer> { @Query(value = "SELECT " + " COUNT(*) count, " + " SUM(amount) vo

我在JPA存储库中有此查询:

@Repository
public interface PaymentTransactionsDailyFactsRepository extends JpaRepository<PaymentTransactionsDailyFacts, Integer> {

    @Query(value = "SELECT " + 
            " COUNT(*) count, " + 
            " SUM(amount) volume, " + 
            " DATE(created_at) date, " + 
            " YEAR(created_at) year, " + 
            " MONTH(created_at) month, " + 
            " WEEK(created_at) week, " + 
            " DAY(created_at) day, " + 
            " type transaction_type, " + 
            " contract_id, merchant_id, terminal_id, " + 
            " status, card_brand, currency " + 
            " FROM payment_transactions " + 
            " WHERE status NOT IN ('pending_async','pending','pending_review','in_progress','new') AND created_at BETWEEN :start_date AND :end_date " + 
            " GROUP by date, contract_id, merchant_id, terminal_id, transaction_type, status, card_brand, currency", nativeQuery = true)
    List<PaymentTransactionsDailyFacts> generateDailyFacts(@Param("start_date") LocalDate start_date, @Param("end_date") LocalDate end_date);
}
当我在MariaDB中执行此查询时,它工作正常:

SELECT  COUNT(*) count,  SUM(amount) volume,  DATE(created_at) date,  YEAR(created_at) year,  MONTH(created_at) month,  WEEK(created_at) week,  DAY(created_at) day,  type transaction_type,  contract_id, merchant_id, terminal_id,  status, card_brand, currency  FROM payment_transactions  WHERE status NOT IN ('pending_async','pending','pending_review','in_progress','new') AND created_at BETWEEN '2011-04-11 00:00:01' AND '2029-04-11 00:00:00'  GROUP by date, contract_id, merchant_id, terminal_id, transaction_type, status, card_brand, currency
我试图在Spring属性文件中添加此配置:

spring.jpa.properties.hibernate.globally_quoted_identifiers=true
spring.jpa.properties.hibernate.globally_quoted_identifiers_skip_column_definitions=true
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
但我不能解决它。你能给我一些解决这个问题的建议吗

spring.jpa.properties.hibernate.globally_quoted_identifiers=true
spring.jpa.properties.hibernate.globally_quoted_identifiers_skip_column_definitions=true
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl