Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

castToNum Int to Double or Float is not works #3728

Open
jepangLee opened this issue Apr 25, 2024 · 1 comment
Open

castToNum Int to Double or Float is not works #3728

jepangLee opened this issue Apr 25, 2024 · 1 comment
Labels

Comments

@jepangLee
Copy link

castToNum Int to Double or Float is not works

i execute this code

JPAQueryFactory
   .select(entity.intColumn.castToNum(Double::class.java))
//    or .select(entity.intColumn.castToNum(Float::class.java))
   .from(entity)
   .fetchOne()

than jpa execute native query

  1. case Double::class.java

select cast(entity0_.int_column as double precision)
from entity

this native query is not works

  1. case Float::class.java

select cast(entity0_.int_column as decimal(19, 2))
from entity

this native query is works. but throw java exception


java.lang.IllegalArgumentException: argument type mismatch

Steps to reproduce

Environment

Querydsl version: 5.0.0 | 5.1.0

Querydsl module:

Database: mariadb 10

JDK: 11

Additional details

@jepangLee jepangLee added the bug label Apr 25, 2024
@velo
Copy link
Contributor

velo commented Apr 30, 2024

Hi @jepangLee , sadly you won't get any help here.

You can try my fork, might work, https://github.com/openfeign/querydsl

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants