mauro_schneider 19 de jul. de 2006
Você esta indicando que seu mapeamento é com uma Composite ID chamada TbModalidadeId, e o erro indica que você não fez esta classe ou não indicou adequadamento o caminho que ela se encontra.
fhsantiago 19 de jul. de 2006
cara, a classe ta la, na verdade eu coloquei os xmls na mesma pasta dos . java pra evitar qualquer problema…
eles estao na pasta hibernate…
rola de vc me dar um exemplozinho ai…
tipo assim
se existisse uma pasta hibernate como ficaria isso?
ramilani12 19 de jul. de 2006
vc indicou no hibernate.cfg.xml o mapping resource esse XML?
fhsantiago 19 de jul. de 2006
olha ele todo ai… essa @#$% ta quase funcionando. ja to puto aqui. valeu…
<? xml version = "1.0" encoding = "utf-8" ?>
<! DOCTYPE hibernate - configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" >
< hibernate - configuration >
< session - factory >
< property name = "hibernate.bytecode.use_reflection_optimizer" >
false
</ property >
< property name = "hibernate.connection.driver_class" >
oracle . jdbc . driver . OracleDriver
</ property >
< property name = "hibernate.connection.password" >
ibict_fs
</ property >
< property name = "hibernate.connection.url" >
jdbc : oracle : thin : @192.168.0.254 : 1521 : sigmab
</ property >
< property name = "hibernate.connection.username" >
ibict_fs
</ property >
< property name = "hibernate.default_schema" > IBICT_FS </ property >
< property name = "hibernate.dialect" >
org . hibernate . dialect . OracleDialect
</ property >
< mapping resource = "hibernate/TbModalidade.hbm.xml" />
< mapping resource = "hibernate/TbInstituicao.hbm.xml" />
< mapping resource = "hibernate/TbSetorProdutivo.hbm.xml" />
< mapping resource = "hibernate/VwCorteAssunto.hbm.xml" />
< mapping resource = "hibernate/VwArea.hbm.xml" />
< mapping resource = "hibernate/TbInstDel.hbm.xml" />
< mapping resource = "hibernate/DwFomentoFundos.hbm.xml" />
< mapping resource = "hibernate/FomentoVigente.hbm.xml" />
< mapping resource = "hibernate/TbAgencia.hbm.xml" />
< mapping resource = "hibernate/StopWord.hbm.xml" />
< mapping resource = "hibernate/TbInstAud.hbm.xml" />
< mapping resource = "hibernate/Auditoria1.hbm.xml" />
< mapping resource = "hibernate/Cargas.hbm.xml" />
< mapping resource = "hibernate/TbEveTipo.hbm.xml" />
< mapping resource = "hibernate/TbEndereco.hbm.xml" />
< mapping resource = "hibernate/TbInsCategoriaOrgao.hbm.xml" />
< mapping resource = "hibernate/BolsaAtiva.hbm.xml" />
< mapping resource = "hibernate/TbInstOrigem.hbm.xml" />
< mapping resource = "hibernate/TbAnaliseCargaA.hbm.xml" />
< mapping resource = "hibernate/TbEventoAudBk.hbm.xml" />
< mapping resource = "hibernate/TbEventoPalavraChave.hbm.xml" />
< mapping resource = "hibernate/TbAnaliseCarga.hbm.xml" />
< mapping resource = "hibernate/TbAplicativo.hbm.xml" />
< mapping resource = "hibernate/DwFundos.hbm.xml" />
< mapping resource = "hibernate/TbCidade.hbm.xml" />
< mapping resource = "hibernate/TbInstMantenedora.hbm.xml" />
< mapping resource = "hibernate/DwPesquisadorRedir.hbm.xml" />
< mapping resource = "hibernate/TbEventos.hbm.xml" />
< mapping resource = "hibernate/TbAnaliseCargaB.hbm.xml" />
< mapping resource = "hibernate/DwFomento.hbm.xml" />
< mapping resource = "hibernate/TbInstTemp.hbm.xml" />
< mapping resource = "hibernate/TbPais.hbm.xml" />
< mapping resource = "hibernate/Servico.hbm.xml" />
< mapping resource = "hibernate/DwFomentoValor.hbm.xml" />
< mapping resource = "hibernate/ErroCargas.hbm.xml" />
< mapping resource = "hibernate/DwFundoEditais.hbm.xml" />
< mapping resource = "hibernate/TbAtivTecnica.hbm.xml" />
< mapping resource = "hibernate/TbPesquisador.hbm.xml" />
< mapping resource = "hibernate/TbInstEndereco.hbm.xml" />
< mapping resource = "hibernate/TbAplicativoAgencia.hbm.xml" />
< mapping resource = "hibernate/TbEventoAud.hbm.xml" />
< mapping resource = "hibernate/TbAnaliseCargaF.hbm.xml" />
< mapping resource = "hibernate/TbAreaConhecimento.hbm.xml" />
< mapping resource = "hibernate/TbEveParceiros.hbm.xml" />
< mapping resource = "hibernate/UsuarioBolsista.hbm.xml" />
< mapping resource = "hibernate/TbUf.hbm.xml" />
< mapping resource = "hibernate/HistoricoAtas.hbm.xml" />
< mapping resource = "hibernate/TbEventoContato.hbm.xml" />
< mapping resource = "hibernate/TbEveContato.hbm.xml" />
< mapping resource = "hibernate/TbGrupoModalidade.hbm.xml" />
< mapping resource = "hibernate/DwPesquisador.hbm.xml" />
< mapping resource = "hibernate/VwAbf.hbm.xml" />
< mapping resource = "hibernate/DwFomentoPalavraChave.hbm.xml" />
< mapping resource = "hibernate/TbEventosOriginal.hbm.xml" />
< mapping resource = "hibernate/TbModalidadePadrao.hbm.xml" />
</ session - factory >
</ hibernate - configuration >
mauro_schneider 19 de jul. de 2006
Um Exemplo do próprio Hibernate
ramilani12 19 de jul. de 2006
veja o erro:
rg.hibernate.MappingException: component class not found: TbModalidadeId
seu XML:
<hibernate-mapping>
<class name="TbModalidadeId" table="TB_MODALIDADE"> //o certo nao seria TbModalidadeId ?
Estou apredendo hibernate agora …
fhsantiago 19 de jul. de 2006
acho que nao. o TB_MODALIDADE é a tabela no banco. essa @#$% dessa classe tdModalidadeId.java o eclipse criou sozinho… nem sei pra que serve essa porcaria…tb to aprendendo agora … mas ja ajudou muito. valeu.
ramilani12 19 de jul. de 2006
Sim , mas seu xxx.hbm.xml
na tag:
<class name="TbModalidadeId" table="TB_MODALIDADE">
o class name=deve ser o mesmo nome da sua classe Pojo , por isso ele gera a exception que nao encontra a classe
keller 19 de jul. de 2006
org.hibernate.MappingException: component class not found: TbModalidadeId
Ele nao esta encontrando a sua classe TbModalidadeId.
Verifique se com os HBMs estao os .CLASS
Package voce esta usando?
( Pelo que eu me lembro no outro topico voce disse que nao )
Valeu? Até… :thumbup:
fhsantiago 19 de jul. de 2006
pois eh. consegui aqui. agora o erro mudou…hehe
2006 - 07 - 19 10 : 48 : 22 , 109 INFO hibernate . cfg . Configuration -> processing extends queue
2006 - 07 - 19 10 : 48 : 22 , 109 INFO hibernate . cfg . Configuration -> processing collection mappings
org . hibernate . MappingException : Association references unmapped class : hibernate . DwFomento
at org . hibernate . cfg . HbmBinder . bindCollectionSecondPass ( HbmBinder . java : 2036 )
at org . hibernate . cfg . HbmBinder $ CollectionSecondPass . secondPass ( HbmBinder . java : 2497 )
at org . hibernate . cfg . HbmBinder $ SecondPass . doSecondPass ( HbmBinder . java : 2468 )
at org . hibernate . cfg . Configuration . secondPassCompile ( Configuration . java : 884 )
mas obrigado a todos
keller 19 de jul. de 2006
org.hibernate.MappingException: Association references unmapped class: hibernate.DwFomento
Uma associacao esta se referindo a uma
classe nao mapeada.
*Dica:
Faca uma nova database “java” ,
com uma tabela “Item” ,
com as colunas “id” e “descricao”.
Trabalhe nessa database e essa tabela.
Quando voce conseguir fazer ela funcionar
com o hibernate o 1o passo esta concluido.
Depois faça alguns relacionamentos.
e entao depois tente colocar o hibernate no seu sistema.
Resumindo , consiga aquilo que chamam de know-how.
Valeu? Até… :thumbup: