Id Hibernate

1 resposta
P

Oi Pessoal
Mais uma dúvida no Hibernate:
Na tabela que tem um relacionamento muitos para muitos, o hibernate está criando a sequence de uma das tabelas:

select sq_ug.nextval from dual

Mas na tabela associativa ele não está conseguindo criar, aí dá o erro:

insert into UG (COD_UG, DSC_UG, DAT_INICIO_UG, STA_UG, DAT_FIM_UG, IND_EMITENTE_RESP_UG, STA_ALTERA, DSC_ABREV_UG, ID_FUNCAO_GESTORA, ID_ORGAO, ID_UG) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
INFO [STDOUT] Hibernate: insert into VINCULACAO (ID_UG, ID_CENTRO_CUSTO) values (?, ?)
WARN [JDBCExceptionReporter] SQL Error: 1400, SQLState: 23000
ERROR [JDBCExceptionReporter] ORA-01400: não é possível inserir NULL em (“SGPD”.“VINCULACAO”.“ID_VINCULACAO”)

Sendo que nesta mesma tabela, eu estou setando a sequence normalmente:

<id

name="id"

type="long"

column=“ID_VINCULACAO”

>

<generator class=“sequence”>

<param name=“sequence”>sq_VINCULACAO</param>

</generator>

</id>

Muito obrigada
Penelope

1 Resposta

J

Oi

Penelope, por favor evite duplicar posts, a resposta sempre chega.

Seu post está sendo respondido no link abaixo

http://www.portaljava.com/home/modules.php?name=Forums&file=viewtopic&t=9098&start=0&postdays=0&postorder=asc&highlight=

T+

Criado 28 de setembro de 2004
Ultima resposta 28 de set. de 2004
Respostas 1
Participantes 2