Created
July 5, 2011 15:12
-
-
Save eduardodaluz/1065031 to your computer and use it in GitHub Desktop.
Arquivo de configuração JPA + Hibernate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### direct log messages to stdout ### | |
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | |
log4j.appender.stdout.Target=System.out | |
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | |
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n | |
### direct messages to file hibernate.log ### | |
#log4j.appender.file=org.apache.log4j.FileAppender | |
#log4j.appender.file.File=hibernate.log | |
#log4j.appender.file.layout=org.apache.log4j.PatternLayout | |
#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n | |
### set log levels - for more verbose logging change 'info' to 'debug' ### | |
log4j.rootLogger=warn, stdout | |
log4j.logger.org.hibernate=info | |
#log4j.logger.org.hibernate=debug | |
### log HQL query parser activity | |
#log4j.logger.org.hibernate.hql.ast.AST=debug | |
### log just the SQL | |
log4j.logger.org.hibernate.SQL=debug | |
### log JDBC bind parameters ### | |
log4j.logger.org.hibernate.type=info | |
#log4j.logger.org.hibernate.type=debug | |
### log schema export/update ### | |
log4j.logger.org.hibernate.tool.hbm2ddl=debug | |
### log HQL parse trees | |
#log4j.logger.org.hibernate.hql=debug | |
### log cache activity ### | |
#log4j.logger.org.hibernate.cache=debug | |
### log transaction activity | |
#log4j.logger.org.hibernate.transaction=debug | |
### log JDBC resource acquisition | |
#log4j.logger.org.hibernate.jdbc=debug | |
### enable the following line if you want to track down connection ### | |
### leakages when using DriverManagerConnectionProvider ### | |
#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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="jpa-hibernate"> | |
<properties> | |
<!-- Informações de conexão --> | |
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" /> | |
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" /> | |
<property name="hibernate.connection.url" value="jdbc:mysql://localhost/MYDATABASE" /> | |
<property name="hibernate.connection.username" value="root" /> | |
<property name="hibernate.connection.password" value="" /> | |
<!-- Provider --> | |
<property name="hibernate.cache.provider_class" "value="org.hibernate.cache.NoCacheProvider" /> | |
<!-- Propriedades da conexão --> | |
<property name="hibernate.hbm2ddl.auto" value="none" /> <!-- Alterações na estrutura do DB: create, update, none --> | |
<property name="hibernate.show_sql" value="true" /> <!-- Saída do SQL --> | |
<property name="hibernate.format_sql" value="true" /> <!-- Formatação do SQL --> | |
</properties> | |
</persistence-unit> | |
</persistence> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment