Erro do hibernate

2 respostas
luistiagos

Alguem sabe que erro e este???

Caused by: org.hibernate.MappingException: Foreign key (FK3CEB571AA7218CA3:PRODUTO_SUB_SERVICO [ID_SERVICO])) must have same number of columns as the referenced primary key (SERVICO_SUB_SERVICO [ID_INSTITUICAO,ID_SERVICO,ID_SUBSERVICO])

at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:90)

at org.hibernate.mapping.ForeignKey.alignColumns(ForeignKey.java:73)

at org.hibernate.cfg.Configuration.secondPassCompileForeignKeys(Configuration.java:1260)

at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1167)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1283)

at br.com.sigma.hibernate.SigmaHibernateUtil.inicializar(SigmaHibernateUtil.java:110)

 19 more

2 Respostas

fsquadro

Luis,

Posta o código, pra gente dar uma olhada, e ficar mais fácil pra te ajudar.

Abraço.

Paulo_Silveira

na tabela
PRODUTO_SUB_SERVICO voce esta querendo fazer uma foreign key do atributo [ID_SERVICO])) para a tabela (SERVICO_SUB_SERVICO) pelas keys [ID_INSTITUICAO,ID_SERVICO,ID_SUBSERVICO]. Mas nao da pra fazer neh? porque no caso da direta voce tem DUAS chaves… precisa ter o mesmo numero.

Criado 23 de março de 2007
Ultima resposta 23 de mar. de 2007
Respostas 2
Participantes 3