public static synchronized boolean applyScript(boolean runScript, String moduleKey, VirtualFile evolutionsDirectory) { // Look over all the DB Set<String> dBNames = Configuration.getDbNames(); for (String dbName : dBNames) { return applyScript(dbName, runScript, moduleKey, evolutionsDirectory); } return true; }
public static synchronized void checkEvolutionsState() { // Look over all the DB Set<String> dBNames = Configuration.getDbNames(); for (String dbName : dBNames) { checkEvolutionsState(dbName); } }
} else if (this.isDefault()) { boolean isDefaultProperty = true; Set<String> dBNames = Configuration.getDbNames(); for (String dbName : dBNames) { if (keyName.startsWith("db." + dbName) ||
/** * Reads the configuration file and initialises required JPA EntityManagerFactories. */ @Override public void onApplicationStart() { org.apache.log4j.Logger.getLogger("org.hibernate.SQL").setLevel(Level.OFF); Set<String> dBNames = Configuration.getDbNames(); for (String dbName : dBNames) { Configuration dbConfig = new Configuration(dbName); if (dbConfig.getProperty("jpa.debugSQL", "false").equals("true")) { org.apache.log4j.Logger.getLogger("org.hibernate.SQL").setLevel(Level.ALL); } Thread thread = Thread.currentThread(); ClassLoader contextClassLoader = thread.getContextClassLoader(); thread.setContextClassLoader(Play.classloader); try { if (Logger.isTraceEnabled()) { Logger.trace("Initializing JPA for %s...", dbName); } JPA.emfs.put(dbName, newEntityManagerFactory(dbName, dbConfig)); } finally { thread.setContextClassLoader(contextClassLoader); } } JPQL.instance = new JPQL(); }
StringWriter sw = new StringWriter(); PrintWriter out = new PrintWriter(sw); Set<String> dbNames = Configuration.getDbNames();
StringWriter sw = new StringWriter(); PrintWriter out = new PrintWriter(sw); Set<String> dbNames = Configuration.getDbNames();
@Override public void beforeInvocation() { if (isDisabled() || Play.mode.isProd()) { return; } try { checkEvolutionsState(); } catch (InvalidDatabaseRevision e) { Set<String> dbNames = Configuration.getDbNames(); for (String dbName : dbNames) { Configuration dbConfig = new Configuration(dbName); for (Entry<String, VirtualFile> moduleRoot : modulesWithEvolutions.entrySet()) { if ("mem".equals(dbConfig.getProperty("db")) && listDatabaseEvolutions(e.getDbName(), moduleRoot.getKey()).peek().revision == 0) { Logger.info("Automatically applying evolutions in in-memory database"); Logger.info("Applying evolutions for '" + moduleRoot.getKey() + "'"); applyScript(true, moduleRoot.getKey(), moduleRoot.getValue()); } else { throw e; } } } } }
Set<String> dBNames = Configuration.getDbNames(); boolean defaultExitCode = true;
Set<String> dbNames = Configuration.getDbNames(); Iterator<String> it = dbNames.iterator(); while (it.hasNext()) {
private boolean changed() { Set<String> dbNames = Configuration.getDbNames();