I brought up to date my application to use hibernate-annotations of 3.1beta7 for 3.2.1.ga and started to give the following problem, sees log:
Sequence is generated correctly but when it makes insert, sequence is placed generated by another strategy that I did not choose.
Database: Oracle 9.2
Code:
@SuppressWarnings("serial")
@Entity()
@Table(name = "FCU_ENTR_DADOS_LUZ")
@SequenceGenerator(name = "FCU_ELU_SQ1", sequenceName = "FCU_ELU_SQ1")
public class EntradaDadosLuz implements Serializable {
@Id() @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FCU_ELU_SQ1")
private Integer seq;
2007-01-02 10:55:24,090 [http-8080-Processor22] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2007-01-02 10:55:24,090 [http-8080-Processor22] DEBUG org.hibernate.SQL - select FCU_ELU_SQ1.nextval from dual
Hibernate: select FCU_ELU_SQ1.nextval from dual
2007-01-02 10:55:24,090 [http-8080-Processor22] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
2007-01-02 10:55:24,090 [http-8080-Processor22] DEBUG org.hibernate.id.SequenceGenerator - Sequence identifier generated: 216
2007-01-02 10:55:24,090 [http-8080-Processor22] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2007-01-02 10:55:24,090 [http-8080-Processor22] DEBUG org.hibernate.jdbc.AbstractBatcher - closing statement
2007-01-02 10:55:24,090 [http-8080-Processor22] DEBUG org.hibernate.id.SequenceHiLoGenerator - new hi value: 216
2007-01-02 10:55:24,105 [http-8080-Processor22] DEBUG
org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 10800, using strategy: org.hibernate.id.SequenceHiLoGenerator
2007-01-02 10:55:24,105 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractSaveEventListener - saving [br.ufrgs.hcpa.persistence.fcu.EntradaDadosLuz#10800]
2007-01-02 10:55:24,121 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - flushing session
2007-01-02 10:55:24,121 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
2007-01-02 10:55:24,137 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
2007-01-02 10:55:24,137 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushing entities and processing referenced collections
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Processing unreferenced collections
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Scheduling collection removes/(re)creates/updates
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 insertions, 0 updates, 0 deletions to 10 objects
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - listing entities:
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.fcu.EntradaDadosLuz{grupoCentroCustos=br.ufrgs.hcpa.persistence.fcu.GrupoCentroCustos#176, criadoPor=null, contribuicao=0.00800, dataInicioValidade=2007-01-02 00:00:00, seq=10800, criadoEm=2007-01-02 10:55:24, dataFimValidade=null}
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.fcu.AgrupamentoGCC{criadoPor=br.ufrgs.hcpa.persistence.rap.Servidor#component[vinculo,matricula]{vinculo=1, matricula=14896}, ordem=35, seq=34, criadoEm=2006-10-11 11:49:49, situacao=ATIVO, descricao=CAPS}
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.rap.PessoaFisica{codigo=25668, nome=ROBERTO DA SILVA ARAUJO, nomeUsual=ROBERTO}
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.rap.Vinculo{seq=1, descricao=FUNCIONARIOS / RESIDENTES}
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.fcu.UnidadeRateio{criadoPor=br.ufrgs.hcpa.persistence.rap.Servidor#component[vinculo,matricula]{vinculo=1, matricula=14896}, seq=5, criadoEm=2006-10-11 08:58:09, situacao=ATIVO, nome=Qt Coletas, descricao=Quantidade de Coletas}
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.rap.Servidor{email=null, vinculo=br.ufrgs.hcpa.persistence.rap.Vinculo#1, servidorPK=component[vinculo,matricula]{vinculo=1, matricula=19626}, pessoaFisica=br.ufrgs.hcpa.persistence.rap.PessoaFisica#25668}
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.rap.Servidor{email=null, vinculo=br.ufrgs.hcpa.persistence.rap.Vinculo#1, servidorPK=component[vinculo,matricula]{vinculo=1, matricula=14896}, pessoaFisica=br.ufrgs.hcpa.persistence.rap.PessoaFisica#1709}
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.fcu.AgrupamentoGCC{criadoPor=br.ufrgs.hcpa.persistence.rap.Servidor#component[vinculo,matricula]{vinculo=1, matricula=14896}, ordem=8, seq=8, criadoEm=2006-10-11 11:49:49, situacao=ATIVO, descricao=NUTRIÇÃO}
2007-01-02 10:55:24,152 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.rap.PessoaFisica{codigo=1709, nome=EDUARDO HAMMARSTRON, nomeUsual=EDUARDO}
2007-01-02 10:55:24,168 [http-8080-Processor22] DEBUG org.hibernate.pretty.Printer - br.ufrgs.hcpa.persistence.fcu.GrupoCentroCustos{criadoPor=br.ufrgs.hcpa.persistence.rap.Servidor#component[vinculo,matricula]{vinculo=1, matricula=19626}, ordem=35, unidadeRateio=br.ufrgs.hcpa.persistence.fcu.UnidadeRateio#5, agrupamentoGCC=br.ufrgs.hcpa.persistence.fcu.AgrupamentoGCC#34, seq=176, criadoEm=2006-12-19 09:42:34, situacao=ATIVO, tipoCustoABC=INTERMEDIARIO, agrupamentoGCCCorresponde=br.ufrgs.hcpa.persistence.fcu.AgrupamentoGCC#8, descricao=GRUPO DE APOIO A PESQUISA, tipoCusto=BASE}
2007-01-02 10:55:24,168 [http-8080-Processor22] DEBUG org.hibernate.event.def.AbstractFlushingEventListener - executing flush
2007-01-02 10:55:24,168 [http-8080-Processor22] DEBUG org.hibernate.jdbc.ConnectionManager - registering flush begin
2007-01-02 10:55:24,168 [http-8080-Processor22] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Inserting entity: [br.ufrgs.hcpa.persistence.fcu.EntradaDadosLuz#10800]
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.SQL - insert into FCU_ENTR_DADOS_LUZ (GCC_SEQ, DT_INICIO_VALIDADE, DT_FIM_VALIDADE, CONTRIBUICAO_KWH, SER_VIN_CODIGO, SER_MATRICULA, CRIADO_EM, seq) values (?, ?, ?, ?, ?, ?, ?, ?)
Hibernate: insert into FCU_ENTR_DADOS_LUZ (GCC_SEQ, DT_INICIO_VALIDADE, DT_FIM_VALIDADE, CONTRIBUICAO_KWH, SER_VIN_CODIGO, SER_MATRICULA, CRIADO_EM, seq) values (?, ?, ?, ?, ?, ?, ?, ?)
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.jdbc.AbstractBatcher - preparing statement
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.persister.entity.AbstractEntityPersister - Dehydrating entity: [br.ufrgs.hcpa.persistence.fcu.EntradaDadosLuz#10800]
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.type.IntegerType - binding '176' to parameter: 1
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.type.TimestampType - binding '2007-01-02 00:00:00' to parameter: 2
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.type.TimestampType - binding null to parameter: 3
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.type.BigDecimalType - binding '0.00800' to parameter: 4
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.type.IntegerType - binding null to parameter: 5
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.type.IntegerType - binding null to parameter: 6
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.type.TimestampType - binding '2007-01-02 10:55:24' to parameter: 7
2007-01-02 10:55:24,184 [http-8080-Processor22] DEBUG org.hibernate.type.IntegerType -
binding '10800' to parameter: 8
2007-01-02 10:55:24,215 [http-8080-Processor22] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2007-01-02 10:55:24,215 [http-8080-Processor22] DEBUG org.hibernate.jdbc.AbstractBatcher - closing statement
2007-01-02 10:55:24,215 [http-8080-Processor22] DEBUG org.hibernate.util.JDBCExceptionReporter - could not insert: [br.ufrgs.hcpa.persistence.fcu.EntradaDadosLuz] [insert into FCU_ENTR_DADOS_LUZ (GCC_SEQ, DT_INICIO_VALIDADE, DT_FIM_VALIDADE, CONTRIBUICAO_KWH, SER_VIN_CODIGO, SER_MATRICULA, CRIADO_EM, seq) values (?, ?, ?, ?, ?, ?, ?, ?)]
java.sql.SQLException: ORA-01438: value larger than specified precision allows for this column
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)