/** * Return a configuration property. */ public String getProperty(String propertyName) { return getProperty(propertyName, null); }
/** * Return a configuration property. */ public String getProperty(String propertyName) { return getProperty(propertyName, null); }
public JsonContext createJsonContext(SpiEbeanServer server) { String s = serverConfig.getProperty("json.pretty", "false"); boolean dfltPretty = "true".equalsIgnoreCase(s); s = serverConfig.getProperty("json.jsonValueAdapter", null); JsonValueAdapter va = new DefaultJsonValueAdapter(); if (s != null) { va = (JsonValueAdapter) ClassUtil.newInstance(s, this.getClass()); } return new DJsonContext(server, va, dfltPretty); }
public JsonContext createJsonContext(SpiEbeanServer server) { String s = serverConfig.getProperty("json.pretty", "false"); boolean dfltPretty = "true".equalsIgnoreCase(s); s = serverConfig.getProperty("json.jsonValueAdapter", null); JsonValueAdapter va = new DefaultJsonValueAdapter(); if (s != null) { va = (JsonValueAdapter) ClassUtil.newInstance(s, this.getClass()); } return new DJsonContext(server, va, dfltPretty); }
/** * Construct with the ClassLoader used to load Ebean.class. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public SubClassManager(ServerConfig serverConfig) { String s = serverConfig.getProperty("subClassManager.preferContextClassloader", "true"); final boolean preferContext = "true".equalsIgnoreCase(s); this.serverName = serverConfig.getName(); this.logLevel = serverConfig.getEnhanceLogLevel(); this.clzMap = new ConcurrentHashMap<String, Class<?>>(); try { subclassFactory = (SubClassFactory) AccessController .doPrivileged(new PrivilegedExceptionAction() { public Object run() { ClassLoader cl = ClassUtil.getClassLoader(this.getClass(), preferContext); logger.info("SubClassFactory parent ClassLoader ["+cl.getClass().getName()+"]"); return new SubClassFactory(cl, logLevel); } }); } catch (PrivilegedActionException e) { throw new PersistenceException(e); } }
/** * Construct with the ClassLoader used to load Ebean.class. */ @SuppressWarnings({ "unchecked", "rawtypes" }) public SubClassManager(ServerConfig serverConfig) { String s = serverConfig.getProperty("subClassManager.preferContextClassloader", "true"); final boolean preferContext = "true".equalsIgnoreCase(s); this.serverName = serverConfig.getName(); this.logLevel = serverConfig.getEnhanceLogLevel(); this.clzMap = new ConcurrentHashMap<String, Class<?>>(); try { subclassFactory = (SubClassFactory) AccessController .doPrivileged(new PrivilegedExceptionAction() { public Object run() { ClassLoader cl = ClassUtil.getClassLoader(this.getClass(), preferContext); logger.info("SubClassFactory parent ClassLoader ["+cl.getClass().getName()+"]"); return new SubClassFactory(cl, logLevel); } }); } catch (PrivilegedActionException e) { throw new PersistenceException(e); } }
/** * Set the naming convention to underscore if it has not already been set. */ private void setNamingConvention(ServerConfig config) { if (config.getNamingConvention() == null) { UnderscoreNamingConvention nc = new UnderscoreNamingConvention(); config.setNamingConvention(nc); String v = config.getProperty("namingConvention.useForeignKeyPrefix"); if (v != null) { boolean useForeignKeyPrefix = Boolean.valueOf(v); nc.setUseForeignKeyPrefix(useForeignKeyPrefix); } String sequenceFormat = config.getProperty("namingConvention.sequenceFormat"); if (sequenceFormat != null) { nc.setSequenceFormat(sequenceFormat); } } }
/** * Set the naming convention to underscore if it has not already been set. */ private void setNamingConvention(ServerConfig config) { if (config.getNamingConvention() == null) { UnderscoreNamingConvention nc = new UnderscoreNamingConvention(); config.setNamingConvention(nc); String v = config.getProperty("namingConvention.useForeignKeyPrefix"); if (v != null) { boolean useForeignKeyPrefix = Boolean.valueOf(v); nc.setUseForeignKeyPrefix(useForeignKeyPrefix); } String sequenceFormat = config.getProperty("namingConvention.sequenceFormat"); if (sequenceFormat != null) { nc.setSequenceFormat(sequenceFormat); } } }
.equalsIgnoreCase(config.getServerConfig().getProperty("defaultUpdateNullProperties", "false")); this.defaultDeleteMissingChildren = "true".equalsIgnoreCase(config.getServerConfig() .getProperty("defaultDeleteMissingChildren", "true"));
.equalsIgnoreCase(config.getServerConfig().getProperty("defaultUpdateNullProperties", "false")); this.defaultDeleteMissingChildren = "true".equalsIgnoreCase(config.getServerConfig() .getProperty("defaultDeleteMissingChildren", "true"));