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

Hibernate @JdbcTypeCode need support #7

Open
solomon-maeng opened this issue Oct 11, 2024 · 2 comments
Open

Hibernate @JdbcTypeCode need support #7

solomon-maeng opened this issue Oct 11, 2024 · 2 comments

Comments

@solomon-maeng
Copy link

solomon-maeng commented Oct 11, 2024

There is a case where @JdbcTypeCode is used as an entity field like below.

@Entity
@Table(name = "order_logs")
class OrderLog(
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    val id: Long = 0L,
    @JdbcTypeCode(SqlTypes.JSON)
    val metadata: Map<String, Any?>
)

I have the following error:
[ksp] java.lang.IllegalStateException: Error processing kr.co.sample.domain.OrderLog.metadata: Type was not recognised, This may be an entity that has not been annotated with @Entity, or maybe you are using javax instead of jakarta.

need support for the @JdbcUserType annotation.

@solomon-maeng solomon-maeng changed the title Hibernate JdbcTypeCode not managed Hibernate @JdbcTypeCode not managed Oct 11, 2024
@solomon-maeng solomon-maeng changed the title Hibernate @JdbcTypeCode not managed Hibernate @JdbcTypeCode need support Oct 11, 2024
@IceBlizz6
Copy link
Owner

Thank you for reporting this.

It seems like the problem is that kotlin.Any isn't supported in my project.
I tried to add support for kotlin.Any now, please try this build:
ksp("com.github.IceBlizz6:querydsl-ksp:d2566c39dd")

@JdbcTypeCode is not being picked up, and i'm not sure if we need to add support for this explicitly unless it changes behavior of how Q classes should be generated.

The code samples you supplied is working on my machine now.

You should be aware that running KSP again after a failure may trigger this bug:
google/ksp#2072 (comment)
it's technically fixed, but the fix has not been released yet.

Please let me know if my build is working,
in which case i will release this in next official version.

@IceBlizz6
Copy link
Owner

Hey,
Were you able to see if the build worked for you?

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

No branches or pull requests

2 participants