org.sonar.jpa.session
Class AbstractDatabaseConnector

java.lang.Object
  extended by org.sonar.jpa.session.AbstractDatabaseConnector
All Implemented Interfaces:
DatabaseConnector
Direct Known Subclasses:
DefaultDatabaseConnector

public abstract class AbstractDatabaseConnector
extends Object
implements DatabaseConnector


Field Summary
protected  Database database
           
protected static org.slf4j.Logger LOG
           
 
Constructor Summary
protected AbstractDatabaseConnector(Database database)
           
 
Method Summary
 javax.persistence.EntityManager createEntityManager()
           
protected  javax.persistence.EntityManagerFactory createEntityManagerFactory()
           
 int getDatabaseVersion()
           
 Dialect getDialect()
           
 String getDialectId()
           
 javax.persistence.EntityManagerFactory getEntityManagerFactory()
           
 boolean isOperational()
          Indicates if the connector is operational : database connection OK and schema version OK
protected  boolean isStarted()
          Indicates if the connector is started : database connection OK and schema version OK or KO
protected  int loadVersion()
           
protected  void setEntityManagerFactory(javax.persistence.EntityManagerFactory factory)
           
 void start()
           
 void stop()
           
protected  boolean upToDateSchemaVersion()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sonar.jpa.session.DatabaseConnector
getConnection
 

Field Detail

LOG

protected static final org.slf4j.Logger LOG

database

protected Database database
Constructor Detail

AbstractDatabaseConnector

protected AbstractDatabaseConnector(Database database)
Method Detail

getDialectId

public String getDialectId()

isOperational

public boolean isOperational()
Indicates if the connector is operational : database connection OK and schema version OK


isStarted

protected boolean isStarted()
Indicates if the connector is started : database connection OK and schema version OK or KO


start

public void start()

stop

public void stop()

getEntityManagerFactory

public javax.persistence.EntityManagerFactory getEntityManagerFactory()
Specified by:
getEntityManagerFactory in interface DatabaseConnector

setEntityManagerFactory

protected void setEntityManagerFactory(javax.persistence.EntityManagerFactory factory)

createEntityManagerFactory

protected javax.persistence.EntityManagerFactory createEntityManagerFactory()

createEntityManager

public javax.persistence.EntityManager createEntityManager()
Specified by:
createEntityManager in interface DatabaseConnector

loadVersion

protected int loadVersion()

upToDateSchemaVersion

protected boolean upToDateSchemaVersion()

getDatabaseVersion

public final int getDatabaseVersion()
Specified by:
getDatabaseVersion in interface DatabaseConnector

getDialect

public final Dialect getDialect()
Specified by:
getDialect in interface DatabaseConnector


Copyright © 2009-2012 SonarSource. All Rights Reserved.