public class Configuration extends Object
Modifier | Constructor and Description |
---|---|
protected |
Configuration() |
Modifier and Type | Method and Description |
---|---|
boolean |
cacheEnabled() |
boolean |
collectStatistics() |
boolean |
collectStatisticsOnHold() |
CacheManager |
getCacheManager() |
ConnectionSpec |
getConnectionSpec(String environment) |
ConnectionSpec |
getCurrentConnectionSpec()
Finds a connection
ConnectionSpec that corresponds to system properties,
environment variables of database.properties configuration, whichever is found first. |
Dialect |
getDialect(MetaModel mm) |
Dialect |
getDialect(String dbType) |
static String |
getEnv()
Returns name of environment, such as "development", "production", etc.
|
String |
getEnvironment() |
static void |
setEnv(String env)
This method must ony be used in tests.
|
public ConnectionSpec getConnectionSpec(String environment)
public ConnectionSpec getCurrentConnectionSpec()
ConnectionSpec
that corresponds to system properties,
environment variables of database.properties
configuration, whichever is found first.
Configuration of system properties overrides environment variables, which overrides
database.properties
.ConnectionSpec
used by DB.open()
to open a "default" connection, as well as Base.open()
methods.public String getEnvironment()
ACTIVE_ENV
of active_env
system property. System property value overrides environment variable.
Defaults to "development" if no environment variable provided.public boolean collectStatistics()
public boolean collectStatisticsOnHold()
public boolean cacheEnabled()
public CacheManager getCacheManager()
public static String getEnv()
ACTIVE_ENV
.public static void setEnv(String env)
env
- name of environment (development, staging, production, etc.).Copyright © 2016 JavaLite. All rights reserved.