0
내가 JPA 포스트 그레스 데이터베이스 (최대 절전 모드)를 사용하고, 나의 최대 절전 모드 데이터베이스 구성은 다음과 같습니다 :JPA 스키마 검증 9.5
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
properties.setProperty("hibernate.hbm2ddl.auto","validate");
나는 속성 테이블이 매핑 된 created_by_user_id
CREATE TABLE dppm_main.user_account_profile
(....//other columns
created_by_user_id integer
)
@Column(name = "created_by_user_id")
private Long createdByUserId;
스키마 유효성 검사를 수행하는 동안 나는 g 랩탑 설치 다음 오류 :
가내가 그것을 어떻게
org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: wrong column
type encountered in column [created_by_user_id] in table [user_account_profile];
**found [int4 (Types#INTEGER)], but expecting [int8 (Types#BIGINT)]**
을 를 해결할 수 ? 이 문제는 여러 곳에서 발생하므로
대신 column을 확장하여 수정할 수 있습니다 .Definition.
에서 [잘못된 열 유형 "매우 유사 테이블 "열 찾기 : int8, 예상 : int4] (http://stackoverflow.com/questions/27230426/wrong-column-type-in-table-for-column-xy-found-int8-expected-int4) –
알아 JPA에 대해서는 아무 것도 없지만 JPA 엔티티가'Long'을 사용하기 때문에 컬럼이'bigint'로 정의 될 것으로 예상한다는 오류 메시지가 제시됩니다. JPA 엔티티에서'Integer'를 사용하거나 테이블 정의에서'bigint'를 사용하십시오. –