I'm troubleshooting with an issue when using PostGIS function st_extent in HQL queries. Entity/Repository:
@Entity
@Table(name = "field")
@Data
public class GeometryEntity {
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "org.hibernate.id.UUIDGenerator")
private UUID id;
@Column(name = "the_geom")
private Polygon geometry;
}
public interface GeometryEntityRepository extends CrudRepository<GeometryEntity, UUID> {
@Query(value = "select extent(geometry) from GeometryEntity")
Optional<Polygon> getExtent();
@Query(value = "select envelope(geometry) from GeometryEntity")
Optional<Polygon> getEnvelope();
}
The attempt to call getExtent() results in:
Using the st_envelope function works as expected.
- spring-boot:3.0.4
- postgres/postgis
- hibernate-spatial:6.1.7
Simple app to reproduce the error: https://github.com/marcozet/spring-boot-3-hibernate-spatial |