TEXT column: Argument data type text is invalid for argument 1 of lower function

Đã Đóng Đã đăng vào 3 năm trước Thanh toán khi bàn giao
Đã Đóng Thanh toán khi bàn giao

I currently have a repo method which is acting as a filter with pagination:

Repo:

@Query("SELECT e FROM DeTest e " +

"WHERE [login to view URL] = '9999-12-31 00:00:00.000' " +

"AND (:name is null OR LOWER ([login to view URL]) LIKE LOWER ('%' + :name+ '%')) " +

"AND (:description is null OR LOWER ([login to view URL]) LIKE LOWER ('%' + :description + '%')) " +

"AND (:theProblem is null OR LOWER ([login to view URL] ) LIKE LOWER ('%' + :theProblem + '%')) "

)

So as shown here, I have it so when you enter a value it will change it ensuring that both uppercase values and lowercase values are displayed. However, when adding LOWER to the 'theProblem' column, it produces the error in the title:

Argument data type text is invalid for argument 1 of lower function

My datatype for that particular column is text, and therefore, I think the culprit of the issue. However, due to the db layout I need it to be a text. Therefore, is there anyway I could convert/cast it in the repo method for when it's called?

Column:

@Column(name = "the_problem", columnDefinition = "TEXT") // text rather than varchar

private String theProblem;

Thank you.

Java Phát triển phần mềm Programming Coding

ID dự án: #27546201

Về dự án

2 đề xuất Dự án từ xa 3 năm trước đang mở

2 freelancer chào giá trung bình£15 cho công việc này

theatasolution1

Hello, I'm an expert Java developer with experience in object-oriented, data structure, swing, JavaFX and more advanced. I can help you to finish this project with great quality. We can negotiate on price/Budget Regard Thêm

£15 GBP trong 1 ngày
(5 Nhận xét)
2.4