有一個使用SQL DDL腳本創建的表,其中有一個_INT8
類型的列。如果我嘗試將它映射到long
(它是Postgres INT8
),它會拋出堆棧的末尾。如何使用Hibernate將Postgres _INT8映射到Java實體?
Caused by: org.hibernate.HibernateException: Wrong column type in [schme_name].[table_name] for column [column_name]. Found: _int8, expected: int8
at org.hibernate.mapping.Table.validateColumns(Table.java:373)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1265)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:155)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:508)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:920)
如果我嘗試將其映射到long[]
(或任何其他數組類型),而不是Found: _int8, expected: bytea
如何Postgres的_INT8
使用Hibernate映射到Java類型?