public class Persistence extends Object
Modifier and Type | Field and Description |
---|---|
static String |
APP_DBS_DIR |
static String |
APP_MODEL_FILE |
protected File |
appDbsDir |
protected File |
appDir |
protected File |
appModelFile |
CacheResetListenerRegistry |
cacheResetListenerRegistry |
static String |
changelogFileNameTemplate |
protected Configuration |
configuration |
static String |
copyright |
protected DatabasePlatformsRegistry |
databasePlatformsRegistry |
static org.slf4j.Logger |
logger |
protected Model |
model |
protected Map<String,HibernateDatabaseSetup> |
setups |
Constructor and Description |
---|
Persistence(File appDir,
Configuration configuration,
DatabasePlatformsRegistry databasePlatformsRegistry) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeSession(HibernateDatabaseSetup current) |
void |
closeSession(String databaseName) |
void |
closeSessions() |
protected HibernateDatabaseSetup |
ensureDatabaseSetup(String databaseName) |
File |
getAppDbsDir() |
File |
getAppModelFile() |
ConnectionProvider |
getConnectionProvider(String databaseName) |
DatabasePlatformsRegistry |
getDatabasePlatformsRegistry() |
Model |
getModel() |
protected File |
getModelDirectory() |
String |
getName() |
Configuration |
getPortofinoProperties() |
Session |
getSession(String databaseName) |
TableAccessor |
getTableAccessor(String databaseName,
String entityName) |
void |
initModel() |
void |
loadXmlModel() |
protected void |
runLiquibase(Database database) |
void |
saveXmlModel() |
void |
start() |
void |
stop() |
void |
syncDataModel(String databaseName) |
public static final String copyright
public static final String APP_DBS_DIR
public static final String APP_MODEL_FILE
public static final String changelogFileNameTemplate
protected final DatabasePlatformsRegistry databasePlatformsRegistry
protected Model model
protected final Map<String,HibernateDatabaseSetup> setups
protected final File appDir
protected final File appDbsDir
protected final File appModelFile
protected final Configuration configuration
public CacheResetListenerRegistry cacheResetListenerRegistry
public static final org.slf4j.Logger logger
public Persistence(File appDir, Configuration configuration, DatabasePlatformsRegistry databasePlatformsRegistry)
public void loadXmlModel()
protected File getModelDirectory()
protected void runLiquibase(Database database)
public void saveXmlModel() throws IOException, JAXBException
IOException
JAXBException
public void initModel()
public ConnectionProvider getConnectionProvider(String databaseName)
public Configuration getPortofinoProperties()
public DatabasePlatformsRegistry getDatabasePlatformsRegistry()
public Model getModel()
protected HibernateDatabaseSetup ensureDatabaseSetup(String databaseName)
public void closeSessions()
public void closeSession(String databaseName)
protected void closeSession(HibernateDatabaseSetup current)
@NotNull public TableAccessor getTableAccessor(String databaseName, String entityName)
public void start()
public void stop()
public String getName()
public File getAppDbsDir()
public File getAppModelFile()