HI,
I have a stupid problem:
I have an entity called DSTST wich has a 1:n relationship to POL.
Now if I want to update my DSTST there is always popping up this exception (see bottom).
I know that setting the DSTSTBO_FK option not-null="false" would help and I have also tried it already. BUT I DON'T UNDERSTAND why hibernate perfoms an update to my POL Entity (see bottom) even if I don't change it.
Hope YOU can help me,
Regards,
Peterson
Full stack trace of any exception that occurs:
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:202)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:91)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:86)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:171)
at org.hibernate.persister.collection.AbstractCollectionPersister.remove(AbstractCollectionPersister.java:965)
at org.hibernate.action.CollectionRemoveAction.execute(CollectionRemoveAction.java:28)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:333)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at at.bias.DststBOFacade(DststBOFacade.java:21)
at at.bias.service.BasicServiceImpl.insertDstst(BasicServiceImpl.java:150)
at pipbasis.Main.main(Main.java:91)
Caused by: java.sql.BatchUpdateException: Data truncation: Column set to default value; NULL supplied to NOT NULL column 'DStST_FK' at row 1
at com.mysql.jdbc.ServerPreparedStatement.executeBatch(ServerPreparedStatement.java:647)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:195)
... 16 more
Name and version of the database you are using: MYSQL 5
Debug level Hibernate log excerpt:
Hibernate: update DSTST set dststidnum=?, name=?, adress=?, SEKTORBO_FK=?, GEMEINDEBO_FK=? where dststid=?
Hibernate: update POL set DSTSTBO_FK=null where DSTSTBO_FK=?
Hibernate version: 3.1
|