Configure hibernate.cfg.xml with DataSource configured in Wildfly 10

0

I'm trying to set up my hibernate to recognize the connection configured in Wildfly, I already tested the connection on the wildfly panel, it's 100% functional. The problem now is to make the application that uses hibernate preview the DS.

    
asked by anonymous 23.06.2017 / 15:12

1 answer

0

Just add the following setting in your persistence.xmm

<persistence-unit name="bell-adm" >

    <provider>org.hibernate.ejb.HibernatePersistence</provider>

    <!-- jta-data-source deve conter o mesmo nome definido em datasource jndi-name no arquivos standalone.xml -->
    <jta-data-source>java:/BellAdmDS</jta-data-source>

    <!-- Entidades -->
    <class>br.com.belladm.model.orm.Usuario</class>
    <class>br.com.belladm.model.orm.Empresa</class>

    <properties>
        <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
        <property name="hibernate.hbm2ddl.auto" value="update"/>
        <property name="hibernate.show_sql" value="true"/>
    </properties>
</persistence-unit>

Follow Example: link

    
12.07.2017 / 18:11