Created
June 5, 2011 21:45
-
-
Save zippy1981/1009458 to your computer and use it in GitHub Desktop.
Example hibernate config files
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
#Updated at Sun Jun 05 14:55:40 EDT 2011 | |
#Sun Jun 05 14:55:40 EDT 2011 | |
database.password=postgres | |
database.url=jdbc\:postgresql\://localhost\:5432/myproject | |
database.username=postgres | |
database.driverClassName=org.postgresql.Driver |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | |
<persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"> | |
<provider>org.hibernate.ejb.HibernatePersistence</provider> | |
<properties> | |
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/> | |
<!-- value="create" to build a new database on each run; value="update" to modify an existing database; value="create-drop" means the same as "create" but also drops tables when Hibernate closes; value="validate" makes no changes to the database --> | |
<property name="hibernate.hbm2ddl.auto" value="create"/> | |
<property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/> | |
<property name="hibernate.connection.charSet" value="UTF-8"/> | |
<!-- Uncomment the following two properties for JBoss only --> | |
<!-- property name="hibernate.validator.apply_to_ddl" value="false" /--> | |
<!-- property name="hibernate.validator.autoregister_listeners" value="false" /--> | |
</properties> | |
</persistence-unit> | |
</persistence> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment