Hibernate: insert into Categoria (nome) values (?) Hibernate: insert into Categoria (nome) values (?) Hibernate: insert into Movimentacao (conta_id, data, descricao, tipoMovimentacao, valor) values (?, ?, ?, ?, ?) Hibernate: insert into Movimentacao (conta_id, data, descricao, tipoMovimentacao, valor) values (?, ?, ?, ?, ?) Hibernate: insert into Movimentacao_Categoria (Movimentacao_id, categorias_id) values (?, ?) Hibernate: insert into Movimentacao_Categoria (Movimentacao_id, categorias_id) values (?, ?) Hibernate: insert into Movimentacao_Categoria (Movimentacao_id, categorias_id) values (?, ?) abr 03, 2020 10:04:34 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions WARN: SQL Error: 1062, SQLState: 23000 abr 03, 2020 10:04:34 AM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions ERROR: Duplicate entry '5' for key 'UK_nf3ulaoqe53gtm70wfwnpl79x' abr 03, 2020 10:04:34 AM org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl release INFO: HHH000010: On release of batch it still contained JDBC statements Exception in thread "main" javax.persistence.RollbackException: Error while committing the transaction at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:81) at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:104) at br.com.alura.jpa.testes.TestaRelacionamnetoMovimentacaoCategoria.main(TestaRelacionamnetoMovimentacaoCategoria.java:51) Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154) at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:181) at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:65) ... 2 more