Skip to content

Can't get querydsl-spatial to work #1255

@Menighin

Description

@Menighin

Important Notice

Thank you for opening an issue! Please note that, as outlined in the README, I currently only work on feature requests or bug fixes when sponsored. Balancing this project with professional and personal priorities means I have a very limited amount of effort I can divert to this project.

You must put in the work to address this issue, or it won't be addressed.

  • I am willing to put in the work and submit a PR to resolve this issue.

Describe the bug
Im trying to setup QueryDSL with PostGis. I have the following dependencies added:

val queryDslVersion = "7.0"

dependencies {
	// QueryDSL
	implementation("io.github.openfeign.querydsl:querydsl-jpa-spring:$queryDslVersion")
	ksp("io.github.openfeign.querydsl:querydsl-ksp-codegen:${queryDslVersion}")
	implementation("io.github.openfeign.querydsl:querydsl-spatial:$queryDslVersion")
	ksp("io.github.openfeign.querydsl:querydsl-spatial:$queryDslVersion")

	// Database
	runtimeOnly("org.postgresql:postgresql")
	implementation("net.postgis:postgis-jdbc:2.5.1")
	implementation("org.liquibase:liquibase-core")
	implementation("org.hibernate.orm:hibernate-spatial:6.6.13.Final")
	implementation("org.locationtech.jts:jts-core:1.19.0")
}

I have my User.kt entity defined:

@Entity
@Table(name = "users")
class User (

    // ...
    @Column(columnDefinition = "geography(Point, 4326)")
    var location: Point? = null,
    // ...
}

On trying to run the project I get

[ksp] java.lang.IllegalStateException: Error processing com.testquerydsl.app.entity.User.location: 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.

Tried a few stuff I saw in the web like annotating the entity colum with @PropertyType but that didnt work. Also apparently there's not much people on this scenario 😅

Im not sure if this is indeed an issue or just me misusing/missing something (wouldn't be the first time). If it is indeed an issue Im up to dig a little bit and try to solve it with a PR.

To Reproduce
Follow the above description

Expected behavior
QueryDSL to generate the class correctly

Desktop (please complete the following information):

  • OS: MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions