第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

org.hibernate.engine.jdbc.spi.SqlExceptionHelper

org.hibernate.engine.jdbc.spi.SqlExceptionHelper

ibeautiful 2022-08-17 17:05:58
在這里,我試圖找到所有在我提供的范圍內(nèi)的實(shí)體。我的意思是,如果我給出一個(gè)特定半徑的圓,它必須顯示所有實(shí)體的位置坐標(biāo)位于給定的圓內(nèi)。我正在使用休眠空間來(lái)實(shí)現(xiàn)這一點(diǎn)。但是在JPA存儲(chǔ)庫(kù)接口中獲得提到的錯(cuò)誤。這是 ,pom.xml<dependency>    <groupId>org.hibernate</groupId>    <artifactId>hibernate-entitymanager</artifactId></dependency><dependency>    <groupId>org.hibernate</groupId>    <artifactId>hibernate-spatial</artifactId>    <version>5.2.12.Final</version></dependency><dependency>    <groupId>org.opengeo</groupId>    <artifactId>geodb</artifactId>    <version>${project.version}</version></dependency><dependency>    <groupId>mysql</groupId>    <artifactId>mysql-connector-java</artifactId>    <version>6.0.6</version></dependency>Jpa Repository,public interface ResourceRepository extends ExtendedJpaRepository<Resource, String> {       @Query(value = "select resource from Resource resource where within(resource.address.location, :circle) = true")    List<Resource> test(@Param("circle") Geometry circle);}Resource.java,@Entity@NoArgsConstructorpublic class Resource extends UUIDEntity2 implements IsResource {    @Type(type = "org.hibernate.spatial.GeometryType")    @OneToOne    private Address address;    /*getters setters*/}Address.java,@Entitypublic class Address extends UUIDEntity2 implements HasEmailAddress, HasLocation {    @Embedded    @Column(columnDefinition = "point")    private Location location;    /*getters setters*/}location.java,@Embeddable@Value(staticConstructor = "of")@RequiredArgsConstructor(staticName = "of")public class Location implements Serializable {    @Column(nullable = true)    private Double lat;    @Column(nullable = true)    private Double lon;}測(cè)試    @Inject    private ResourceRepository resourceRepository;    public Geometry createCircle(double x, double y, double radius) {        GeometricShapeFactory shapeFactory = new GeometricShapeFactory();        shapeFactory.setNumPoints(32);        shapeFactory.setCentre(new Coordinate(x, y));        shapeFactory.setSize(radius * 2);        return shapeFactory.createCircle();    }
查看完整描述

1 回答

?
森欄

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超5個(gè)贊

聽起來(lái)你沒有配置MySQL。您能驗(yàn)證您是否有該行嗎?SpatialDialect

hibernate.dialect=org.hibernate.spatial.dialect.mysql.MySQL56SpatialDialect

在文件中。hibernate.properties

您還可以檢查日志,了解Hibernate實(shí)際使用的方言。它的名稱中應(yīng)包含“空間”,以便空間函數(shù)可用于休眠。


查看完整回答
反對(duì) 回復(fù) 2022-08-17
  • 1 回答
  • 0 關(guān)注
  • 564 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)