Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hibernate-spatial 을 이용한 MariaDB Point 타입 데이터 추출 이슈 #13

Open
tlsdhsdb opened this issue Jul 19, 2022 · 1 comment
Assignees
Labels
bug Something isn't working feature New feature help wanted Extra attention is needed

Comments

@tlsdhsdb
Copy link
Contributor

tlsdhsdb commented Jul 19, 2022

  • 개요 : maria db 에 point 타입으로 경도,위도를 데이터를 저장한 후, hibernate-spatial 을 통해 데이터를 가져오려했으나 해당 부분에 대해서 에러가 발생함.
  • 별도의 함수 작성 없이 findAll()을 통해 Point 데이터를 불러올 경우에만 작동이 되지 않았음. 즉, Point 타입의 데이터가 포함된 경우에만 작동하지 않았음.

당시 발생한 에러로그

Cannot call sendError() after the response has been committed

https://stackoverflow.com/questions/57309861/how-to-read-geography-values-using-hibernate

  • 당시 사용했던 데이터베이스 관련 쿼리문
create table information(
		           id INT NOT NULL AUTO_INCREMENT COMMENT '음식점 ID',
                           name VARCHAR(100) NOT NULL COMMENT '음식점명',
                           gubun VARCHAR(50) NOT NULL COMMENT '음식점 분류',
                           gugun VARCHAR(50) NOT NULL COMMENT '구명' ,
                           location POINT NOT NULL COMMENT '좌표',
                           cntct VARCHAR(100) NOT NULL COMMENT '전화번호',
                           homepage_url VARCHAR(255) COMMENT '식당 홈페이지 주소',
                           usage_of_week_and_time VARCHAR(100) COMMENT '식당영업시간',
                           address VARCHAR(100) NOT NULL COMMENT '식당주소',

                           PRIMARY KEY (id)
)
insert into information
(name, gubun, gugun, location, cntct, 
homepage_url, usage_of_week_and_time, address)
values('부탄츄','일식','마포구',ST_GeomFromText('POINT(37.5564036476463 126.926735502823)'),
'02-3144-3304','https://www.instagram.com/butanchu_seoul/',
'월-토: 11:30 - 23:00 일: 11:30 - 21:30','서울특별시 마포구 와우산로35길 75');
@tlsdhsdb tlsdhsdb added the bug Something isn't working label Jul 19, 2022
@Queue-ri Queue-ri added feature New feature help wanted Extra attention is needed and removed bug Something isn't working labels Jul 19, 2022
@Queue-ri Queue-ri changed the title JPA Spatial 을 이용하여 Maria DB Point 타입 데이터 추출 이슈 hibernate-spatial 을 이용하여 MariaDB Point 타입 데이터 추출 이슈 Jul 20, 2022
@Queue-ri Queue-ri changed the title hibernate-spatial 을 이용하여 MariaDB Point 타입 데이터 추출 이슈 hibernate-spatial 을 이용한 MariaDB Point 타입 데이터 추출 이슈 Jul 20, 2022
@Queue-ri Queue-ri pinned this issue Jul 20, 2022
@Queue-ri
Copy link
Member

hibernate-spatial과 mariaDB 간의 비호환이 의심되어 당분간 Decimal로 대체합니다.

@Queue-ri Queue-ri added the bug Something isn't working label Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature New feature help wanted Extra attention is needed
Development

No branches or pull requests

2 participants