Exemplo do arquivo hibernate-cfg.xml

1 resposta
Marcio_Nogueira

Olá, preciso de um exemplo do arquivo hibernate-cfg.xml para me basear. Estou iniciando no hibernate (e apanhando) para utilizar este treco hehehe.

1 Resposta

EugenioMonteiro
<?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.dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/NOME_BASE_DADOS</property>
    <property name="hibernate.connection.username">USUARIO</property>
    <property name="hibernate.connection.password">SENHA</property>
    <mapping resource="negocio/Orcamento.hbm.xml"/>
    <mapping resource="negocio/Conserto.hbm.xml"/>
    <mapping resource="negocio/ClienteComprouPeca.hbm.xml"/>
    <mapping resource="negocio/Cliente.hbm.xml"/>
    <mapping resource="negocio/Usuario.hbm.xml"/>
    <mapping resource="negocio/Peca.hbm.xml"/>
    <mapping resource="negocio/ConsertoUtilizouPeca.hbm.xml"/>
  </session-factory>
</hibernate-configuration>
Criado 17 de setembro de 2009
Ultima resposta 18 de set. de 2009
Respostas 1
Participantes 2