hey i would like to get some help, i use hibernate 6.5, i followed the documentions and everything, and use jts to add geometeric point to my entity in my project :
@Entity
@Table(name = "OBJECTS_TBL")
public class ObjectEntity {
@Id
private String objectId;
private String type;
private String alias;
private Boolean active;
private String createdBy;
private Point geom;
which complied perfectly as seems below:
Hibernate:
Hibernate:
create table objects_tbl (
active boolean,
creation_timestamp timestamp(6),
alias varchar(255),
created_by varchar(255),
object_id varchar(255) not null,
type varchar(255),
geom geometry,
object_details clob,
primary key (object_id)
)
the problem im dealing with, is that my crud which using this entity, cant i detect st_dwithin
public interface ObjectCrud extends JpaRepository<ObjectEntity, String> {
@Query("SELECT o"
+ " FROM ObjectEntity o "
+ "WHERE st_dwithin(o.geom, st_point( :lng , :lat) ,:distance ) = true")
}
Caused by: java.lang.IllegalArgumentException: org.hibernate.query.SemanticException: Cannot compare left expression of type 'java.lang.Object' with right expression of type 'java.lang.Boolean'
my gradle and my proprties:
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
logging.level.org.hibernate.orm.jdbc.bind=trace
logging.level.org.springframework.transaction=trace
logging.level.org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping=trace
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
// https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-starter-webmvc-ui
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.5.0'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.locationtech.jts:jts-core:1.19.0'
implementation 'org.hibernate.orm:hibernate-spatial:6.5.2.Final'
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.postgresql:postgresql' // note postgresql support
developmentOnly 'org.springframework.boot:spring-boot-docker-compose' // note docker compose support
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' // note test plan management support
im sitll entry level anything can help, thanks