Das Feld ist als bytea definiert. Ich habe als Dialekt org.hibernate.dialect.PostgreSQLDialect gewählt.
column "protocol" == bArray
Hier die komplette Fehlermeldung, die ich erhalte:
Hibernate: insert into protocol (creation_date, name, protocol, protocol_type, userref, id) values (?, ?, ?, ?, ?, ?)
0 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: null
0 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Batch-Eintrag 0 insert into protocol (creation_date, name, protocol, protocol_type, userref, id) values (2008-05-06 09:01:31.852000 +02:00:00, test1, 36037, NORMAL, 29, 30) wurde abgebrochen. Rufen Sie 'getNextException' auf, um die Ursache zu erfahren.
0 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 42804
0 [main] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: column "protocol" is of type bytea but expression is of type bigint
31 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at Test.main(Test.java:229)
Caused by: java.sql.BatchUpdateException: Batch-Eintrag 0 insert into protocol (creation_date, name, protocol, protocol_type, userref, id) values (2008-05-06 09:01:31.852000 +02:00:00, test1, 36037, NORMAL, 29, 30) wurde abgebrochen. Rufen Sie 'getNextException' auf, um die Ursache zu erfahren.
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2534)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1317)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2596)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 8 more
Exception in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at Test.main(Test.java:229)
Caused by: java.sql.BatchUpdateException: Batch-Eintrag 0 insert into protocol (creation_date, name, protocol, protocol_type, userref, id) values (2008-05-06 09:01:31.852000 +02:00:00, test1, 36037, NORMAL, 29, 30) wurde abgebrochen. Rufen Sie 'getNextException' auf, um die Ursache zu erfahren.
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2534)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1317)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2596)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 8 more