|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eiichiro.jazzmaster.Component<javax.persistence.EntityManagerFactory>
org.eiichiro.gig.heroku.HerokuJPAEntityManagerFactory
@Singleton public class HerokuJPAEntityManagerFactory
HerokuJPAEntityManagerFactory is a representing JPA 2.0
EntityManagerFactory for PostgreSQL-based Heroku database service.
| Constructor Summary | |
|---|---|
HerokuJPAEntityManagerFactory()
|
|
| Method Summary | |
|---|---|
void |
close()
Lifecycle callback to close the EntityManagerFactory set. |
void |
configure()
Configures JPA's JDBC connection properties from the environment variable 'DATABASE_URL' and gets the persistence units to be connected from a PersistenceXMLProcessor. |
javax.persistence.EntityManagerFactory |
instance()
Returns the EntityManagerFactory instance corresponding to the
persistence unit the current application connects. |
List<String> |
persistenceUnits()
|
Map<String,String> |
properties()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HerokuJPAEntityManagerFactory()
| Method Detail |
|---|
@Constructed public void configure()
PersistenceXMLProcessor.
@Passivated public void close()
EntityManagerFactory set.
public javax.persistence.EntityManagerFactory instance()
EntityManagerFactory instance corresponding to the
persistence unit the current application connects.
If the PersistenceXMLProcessor detects multiple persistence unit
declarations, this class connects the first-detected one (Index 0 of the
persistence unit list that the PersistenceXMLProcessor#persistenceUnits()
returns).
If the current application cannot access to the database service for any
reasons, this method returns null.
Note: In the future, the implementation will be improved for
multitenant applications. The persistence unit set on the current thread
via something like "Namespaces API" will be used for the
EntityManagerFactory creation.
instance in class org.eiichiro.jazzmaster.Component<javax.persistence.EntityManagerFactory>EntityManagerFactory instance corresponding to the
persistence unit the current application connects.public Map<String,String> properties()
public List<String> persistenceUnits()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||