/** * Check the provided map for an object with the given key. If that object is not available, check the * System properties. If it is not available from either location, return the default value. * @param propertyKey * @param map * @param defaultValue * @return */ public static String getConfigPropertyAsString(String propertyKey, Map overrides, String defaultValue){ String value = getConfigPropertyAsString(propertyKey, overrides); if (value == null){ value = defaultValue; } return value; }
public static void runInSEMode(SchemaManager mgr, boolean shouldDropFirst) { String str = getConfigPropertyAsString(JAVASE_DB_INTERACTION, null ,"true"); boolean interactWithDB = Boolean.valueOf(str.toLowerCase()).booleanValue(); if (!interactWithDB){ return; } createOrReplaceDefaultTables(mgr, shouldDropFirst); }
/** * This is a TEMPORARY method that will be removed. * DON'T USE THIS METHOD - for internal use only. * @param Map m * @param AbstractSession session */ public static void translateOldProperties(Map m, AbstractSession session) { for(int i=0; i < oldPropertyNames.length; i++) { Object value = getConfigPropertyAsString(oldPropertyNames[i][1], m); if(value != null) { if(session != null){ session.log(SessionLog.INFO, SessionLog.TRANSACTION, "deprecated_property", oldPropertyNames[i]); } m.put(oldPropertyNames[i][0], value); } } }
ddlGeneration = (String)getConfigPropertyAsString(DDL_GENERATION, props, NONE); ddlGeneration = ddlGeneration.toLowerCase(); if(ddlGeneration.equals(NONE)) { String ddlGenerationMode = (String) getConfigPropertyAsString(DDL_GENERATION_MODE, props, DEFAULT_DDL_GENERATION_MODE); appLocation = (String)getConfigPropertyAsString( APP_LOCATION, props, DEFAULT_APP_LOCATION); createDDLJdbc = (String)getConfigPropertyAsString( CREATE_JDBC_DDL_FILE, props, DEFAULT_CREATE_JDBC_FILE_NAME); dropDDLJdbc = (String)getConfigPropertyAsString( DROP_JDBC_DDL_FILE, props, DEFAULT_DROP_JDBC_FILE_NAME);
if (EntityManagerFactoryProvider.getConfigPropertyAsString(TopLinkProperties.JDBC_BIND_PARAMETERS, m) == null) {
/** * Set ServerSession name but do not register the session. * The session registration should be done in sync * with increment of the deployment counter, as otherwise the * undeploy will not behave correctly in case of a more * than one predeploy request for the same session name. * @param m the combined properties map. */ protected void setServerSessionName(Map m) { // use default session name if none is provided String name = EntityManagerFactoryProvider.getConfigPropertyAsString(TopLinkProperties.SESSION_NAME, m); if(name == null) { if (persistenceUnitInfo.getPersistenceUnitRootUrl() != null){ name = persistenceUnitInfo.getPersistenceUnitRootUrl().toString() + "-" + persistenceUnitInfo.getPersistenceUnitName(); } else { name = persistenceUnitInfo.getPersistenceUnitName(); } } session.setName(name); }
String weaving = EntityManagerFactoryProvider.getConfigPropertyAsString(TopLinkProperties.WEAVING, mergedProperties, null);