Package NTNU.IDATT1002
Class Config
java.lang.Object
NTNU.IDATT1002.Config
public class Config
extends java.lang.Object
Application Configuration Singleton for parsing hibernate persistence properties and Google Maps API key.
Provides a single global access point to the applications
EntityManagerFactory
.-
Method Summary
Modifier and Type Method Description static void
closeEntityManagerFactory()
Close theEntityManager
instance.static javax.persistence.EntityManager
createEntityManager()
Retrieve a newEntityManager
instance.static java.lang.String
getGoogleApiKey()
-
Method Details
-
getGoogleApiKey
public static java.lang.String getGoogleApiKey() -
closeEntityManagerFactory
public static void closeEntityManagerFactory()Close theEntityManager
instance. -
createEntityManager
public static javax.persistence.EntityManager createEntityManager()Retrieve a newEntityManager
instance. AnEntityManagerFactory
is not created until it is requested.- Returns:
- an entity manager instance
-