Hibernate Configuration File

Pessoal,

Estou fazendo uns testes com o Hibernate 2.1.2. Havia feito uns testes com o 1.x mas mudou muita coisa.

Eu tenho o meu properties que está da seguinte maneira:

hibernate.connection.driver_class = com.mysql.jdbc.Driver hibernate.connection.url = jdbc:mysql://localhost/abr hibernate.connection.username = abr hibernate.connection.password = abr hibernate.dialect = net.sf.hibernate.dialect.MySQLDialect hibernate.show_sql = true

Não sei o porque, mas ele não está aceitando, e pede o hibernate.cfg.xml:

net.sf.hibernate.HibernateException: /hibernate.cfg.xml not found

Eu tenho que usar o cfg.xml? Estou procurando documentação no site do Hibernate mas não acho nada… se alguém puder me ajudar!

Valeu

[]'s

Olá,

vc está usando algo do tipo:

configuration = (new Configuration()).configure(); // sem passagem de parametro

Assim ele busca o arquivo default que é hibernate.cfg.xml

É isso mesmo o que eu faço.

O que devo fazer? Criar um arquivo *.cfg.xml ou passar o hibernate.properties?

Caso eu deva criar, você tem algum exemplo ou algum link onde eu possa olhar para criar o arquivo?

Valeu…

Percebi a cagada… tenho que passar a Class ou *.hbm.xml

Valeu!