Skip to content

Instantly share code, notes, and snippets.

@gpedro
Last active September 14, 2018 02:48
Show Gist options
  • Save gpedro/71719f6c4b6cae87c0b445453a809aac to your computer and use it in GitHub Desktop.
Save gpedro/71719f6c4b6cae87c0b445453a809aac to your computer and use it in GitHub Desktop.
Configuração do Projeto - persistence.xml (depois)
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="Xablau">
<!-- adicionar esta referencia ao jndi -->
<non-jta-data-source>java:comp/env/jdbc/xablau</non-jta-data-source>
<properties>
<!-- pode comentar ou excluir
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/xablau" />
<property name="hibernate.connection.username" value="postgres" />
<property name="hibernate.connection.password" value="postgres" />
-->
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.hbm2ddl.auto" value="update" />
</properties>
</persistence-unit>
</persistence>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment