Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.06 KB

File metadata and controls

35 lines (27 loc) · 1.06 KB

1. ORDER BY ?

The ORDER BY clause generates SQL that uses the original column names of the table, instead of the aliases that were previously specified. At the moment, this is an incorrect YDB request.

select 
    student0_.studentId as studenti1_1_, 
    student0_.groupId as groupid2_1_, 
    student0_.name as name3_1_ 
from Students student0_ order by student0_.name_

At the moment, our solution to this problem is to use native SQL for queries or upgrade to Hibernate 6.

2. ESCAPE ? GENERATED BY Spring Data JPA

The Spring Data JPA framework generates the LAKE ? ESCAPE ? clause when the repository method signature contains the substring ByFieldContains. At the moment, this is an incorrect YDB request. ESCAPE don't have param.


Here is an example solution to problems 1 and 2 using native SQL:

@Query(
        "SELECT * FROM books WHERE books.title LIKE %:title% ORDER BY books.publication_date",
        nativeQuery = true
)
fun findBooksByTitleContainsOrderByPublicationDate(title: String, pageable: Pageable): Slice<Book>