Marco Zühlke (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=61f9220...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMTYyMjM1YTU0...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16369?atlOrigin=eyJpIjoiMTYyMj...
) HHH-16369 (
https://hibernate.atlassian.net/browse/HHH-16369?atlOrigin=eyJpIjoiMTYyMj...
) function extent(geometry) does not exist (
https://hibernate.atlassian.net/browse/HHH-16369?atlOrigin=eyJpIjoiMTYyMj...
)
Issue Type: Bug Affects Versions: 6.1.7 Assignee: Unassigned Components: hibernate-spatial
Created: 24/Mar/2023 10:42 AM Priority: Major Reporter: Marco Zühlke (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=61f9220...
)
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:
2023-03-24T17:19:37.115+01:00 ERROR 456308 --- [ main]
o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: function extent(geometry) does not
exist
Hinweis: No function matches the given name and argument types. You might need to add
explicit type casts.
Position: 8
org.springframework.dao.InvalidDataAccessResourceUsageException: JDBC exception executing
SQL [select extent(g1_0.the_geom) from field g1_0]; SQL [n/a]
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 (
https://github.com/marcozet/spring-boot-3-hibernate-spatial )
(
https://hibernate.atlassian.net/browse/HHH-16369#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16369#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100219- sha1:ac3e918 )