Last active
March 17, 2017 04:43
-
-
Save thjanssen/f0a9575d236e2792f1f3c110342f1443 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
ServiceRegistry standardRegistry = new StandardServiceRegistryBuilder().configure() | |
.build(); |
This file contains hidden or 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
SessionFactory sessionFactory = new MetadataSources(standardRegistry).addAnnotatedClass(Author.class) | |
.buildMetadata() | |
.buildSessionFactory(); | |
Session session = sessionFactory.openSession(); |
This file contains hidden or 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
<hibernate-configuration> | |
<session-factory> | |
<property name="dialect"> | |
org.hibernate.dialect.PostgreSQLDialect | |
</property> | |
<property name="connection.driver_class"> | |
org.postgresql.Driver | |
</property> | |
<property name="connection.url"> | |
jdbc:postgresql://localhost:5432/recipes | |
</property> | |
<property name="connection.username">postgres</property> | |
<property name="connection.password">postgres</property> | |
<property name="connection.pool_size">1</property> | |
<property name="hbm2ddl.auto">create</property> | |
</session-factory> | |
</hibernate-configuration> |
This file contains hidden or 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
<dependency> | |
<groupId>org.hibernate</groupId> | |
<artifactId>hibernate-core</artifactId> | |
<version>5.2.8.Final</version> | |
</dependency> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment