Hibernate 3.6 work well to import sql data like: ... SELECT pg_catalog.setval('customer_id_seq', 2, true); INSERT INTO customer VALUES (1, 'Customer1'); INSERT INTO customer VALUES (2, 'Customer2'); ...
But Hibernate 4xx (4.2.0.FINAL and 4.2.7 FINAL) throws exeption on line 1 (SELECT pg_catalog.setval('customer_id_seq', 2, true);) :
... org.hibernate.tool.hbm2ddl.ImportScriptException: Error during statement execution (file: 'import.sql'): SELECT pg_catalog.setval('customer_id_seq', 4, true) at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:451) ~[hibernate-core-4.2.0.Final.jar:4.2.0.Final] ... Caused by: org.postgresql.util.PSQLException: A result was returned when none was expected. at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:307) ~[postgresql-9.1-901.jdbc4.jar:na] ...
I'v try all PostgesQL dialects - PostgreSQLDialect PostgreSQL82Dialect PostgreSQL80Dialect
|