Closed
Description
Migrating from Spring Boot 3.3.5 to 3.4 lead to this error
The error
Caused by: org.springframework.data.jpa.repository.query.BadJpqlGrammarException: Line 4:8 mismatched input 'ON' expecting {, ','}; Bad JPQL grammar [
INSERT INTO AggregationPrice(range, price, type)
VALUES (:range, :price, :priceType)
ON CONFLICT (range) DO UPDATE
SET price = :price, type = :priceType
]
The code
@Modifying
@Query(
"""
INSERT INTO AggregationPrice(range, price, type)
VALUES (:range, :price, :priceType)
ON CONFLICT (range) DO UPDATE
SET price = :price, type = :priceType
"""
)
fun save(range: Range<LocalDateTime>, price: Double, priceType: AggregationPriceType)