Class SessionFactoryProvider

java.lang.Object
me.nickhanson.codeforge.persistence.SessionFactoryProvider

public class SessionFactoryProvider extends Object
Provides a singleton SessionFactory for Hibernate ORM. Resolution order for config values: 1) System properties (e.g. -Dhibernate.connection.url=...) 2) Environment variables (e.g. DB_HOST, DB_USER, DB_PASS, ...) 3) local.properties (on classpath, git-ignored; for local dev) 4) Hard-coded default (only for non-secret things)
  • Constructor Details

    • SessionFactoryProvider

      public SessionFactoryProvider()
  • Method Details

    • getSessionFactory

      public static org.hibernate.SessionFactory getSessionFactory()
      Gets the singleton SessionFactory instance.