public static String getRegionPrefix(Properties properties) { return PropertiesHelper.getString(Environment.CACHE_REGION_PREFIX, properties, null); }
public void configure(Type type, Properties params, Dialect d) { sep = PropertiesHelper.getString("separator", params, ""); }
public static String getRegionPrefix(Properties properties) { return PropertiesHelper.getString(Environment.CACHE_REGION_PREFIX, properties, null); }
public void configure(Type type, Properties params, Dialect d) { sep = PropertiesHelper.getString("separator", params, ""); }
@Override public void configure( Type type, Properties properties, Dialect dialect ) throws MappingException { String defaultSeqValue = "hibernate_sequence"; String sequenceName = PropertiesHelper.getString( SEQUENCE, properties, defaultSeqValue ); // use "intact_ac" only if the default sequence name is provided if ( sequenceName.equals( defaultSeqValue ) ) { sequenceName = INTACT_AC_SEQUENCE_NAME; properties.put( SEQUENCE, sequenceName ); } super.configure( type, properties, dialect ); }
public static BytecodeProvider buildBytecodeProvider(Properties properties) { String provider = PropertiesHelper.getString( Environment.BYTECODE_PROVIDER, properties, "cglib" ); log.info( "Bytecode provider name : " + provider ); return buildBytecodeProvider( provider ); }
/** * Create a cache using the given settings and properties. * * @param settings The Hibernate settings * @param properties The configuration properties * @return The created cache */ protected Cache createSharedCache(Settings settings, Properties properties) { String configResource = PropertiesHelper.getString(CACHE_RESOURCE_PROP, properties, null); if (configResource == null) { configResource = PropertiesHelper.getString(LEGACY_CACHE_RESOURCE_PROP, properties, DEFAULT_CACHE_RESOURCE); } return new DefaultCacheFactory().createCache(configResource, false); }
public void configure(Type type, Properties params, Dialect dialect) throws MappingException { sequenceName = PropertiesHelper.getString(SEQUENCE, params, "hibernate_sequence"); parameters = params.getProperty(PARAMETERS); String schemaName = params.getProperty(SCHEMA); String catalogName = params.getProperty(CATALOG); if (sequenceName.indexOf( '.' ) < 0) { sequenceName = Table.qualify( catalogName, schemaName, sequenceName ); } this.identifierType = type; sql = dialect.getSequenceNextValString(sequenceName); }
protected CacheProvider createCacheProvider(Properties properties) { String cacheClassName = PropertiesHelper.getString( Environment.CACHE_PROVIDER, properties, "org.hibernate.cache.EhCacheProvider" ); log.info("Cache provider: " + cacheClassName); try { return (CacheProvider) ReflectHelper.classForName(cacheClassName).newInstance(); } catch (Exception cnfe) { throw new HibernateException("could not instantiate CacheProvider: " + cacheClassName, cnfe); } }
protected CacheProvider createCacheProvider(Properties properties) { String cacheClassName = PropertiesHelper.getString( Environment.CACHE_PROVIDER, properties, DEF_CACHE_PROVIDER ); log.info("Cache provider: " + cacheClassName); try { return (CacheProvider) ReflectHelper.classForName(cacheClassName).newInstance(); } catch (Exception cnfe) { throw new HibernateException("could not instantiate CacheProvider: " + cacheClassName, cnfe); } }
protected QueryCacheFactory createQueryCacheFactory(Properties properties) { String queryCacheFactoryClassName = PropertiesHelper.getString( Environment.QUERY_CACHE_FACTORY, properties, "org.hibernate.cache.StandardQueryCacheFactory" ); log.info("Query cache factory: " + queryCacheFactoryClassName); try { return (QueryCacheFactory) ReflectHelper.classForName(queryCacheFactoryClassName).newInstance(); } catch (Exception cnfe) { throw new HibernateException("could not instantiate QueryCacheFactory: " + queryCacheFactoryClassName, cnfe); } }
protected QueryTranslatorFactory createQueryTranslatorFactory(Properties properties) { String className = PropertiesHelper.getString( Environment.QUERY_TRANSLATOR, properties, "org.hibernate.hql.ast.ASTQueryTranslatorFactory" ); log.info("Query translator: " + className); try { return (QueryTranslatorFactory) ReflectHelper.classForName(className).newInstance(); } catch (Exception cnfe) { throw new HibernateException("could not instantiate QueryTranslatorFactory: " + className, cnfe); } }
protected QueryCacheFactory createQueryCacheFactory(Properties properties) { String queryCacheFactoryClassName = PropertiesHelper.getString( Environment.QUERY_CACHE_FACTORY, properties, "org.hibernate.cache.StandardQueryCacheFactory" ); log.info("Query cache factory: " + queryCacheFactoryClassName); try { return (QueryCacheFactory) ReflectHelper.classForName(queryCacheFactoryClassName).newInstance(); } catch (Exception cnfe) { throw new HibernateException("could not instantiate QueryCacheFactory: " + queryCacheFactoryClassName, cnfe); } }
/** * Create a cache using the given settings and properties. * * @param settings The Hibernate settings * @param properties The configuration properties * @return The created cache */ protected Cache createSharedCache(Settings settings, Properties properties) { String configResource = PropertiesHelper.getString(CACHE_RESOURCE_PROP, properties, DEFAULT_CACHE_RESOURCE); return DefaultCacheFactory.getInstance().createCache(configResource, false); }
public void configure(Type type, Properties params, Dialect dialect) throws MappingException { this.sequenceName = PropertiesHelper.getString(SEQUENCE, params, "hibernate_sequence"); this.parameters = params.getProperty(PARAMETERS); String schemaName = params.getProperty(SCHEMA); String catalogName = params.getProperty(CATALOG); if (sequenceName.indexOf(dialect.getSchemaSeparator() ) < 0) { sequenceName = Table.qualify(catalogName, schemaName, sequenceName, dialect.getSchemaSeparator() ); } this.identifierType = type; sql = dialect.getSequenceNextValString(sequenceName); }
public void configure(Type type, Properties params, Dialect dialect) { this.tableName = PropertiesHelper.getString(TABLE, params, DEFAULT_TABLE_NAME); this.columnName = PropertiesHelper.getString(COLUMN, params, DEFAULT_COLUMN_NAME); String schemaName = params.getProperty(SCHEMA); String catalogName = params.getProperty(CATALOG); if (tableName.indexOf(dialect.getSchemaSeparator() )<0) { tableName = Table.qualify(catalogName, schemaName, tableName, dialect.getSchemaSeparator() ); } query = "select " + columnName + " from " + dialect.appendLockHint(LockMode.UPGRADE, tableName) + dialect.getForUpdateString(); update = "update " + tableName + " set " + columnName + " = ? where " + columnName + " = ?"; }
@Override protected Cache createSharedCache(Settings settings, Properties properties) { String name = PropertiesHelper.getString(CACHE_RESOURCE_PROP, properties, null); if (name == null) throw new CacheException("Configuration property " + CACHE_RESOURCE_PROP + " not set"); return locateCache( name, NamingHelper.getJndiProperties( properties ) ); }
@Override protected Cache createSharedCache(Settings settings, Properties properties) { String name = PropertiesHelper.getString(CACHE_RESOURCE_PROP, properties, null); if (name == null) throw new CacheException("Configuration property " + CACHE_RESOURCE_PROP + " not set"); return locateCache( name, NamingHelper.getJndiProperties( properties ) ); }
@Override public void start(Settings settings, Properties properties) throws CacheException { String name = PropertiesHelper.getString(CACHE_FACTORY_RESOURCE_PROP, properties, null); if (name == null) throw new CacheException("Configuration property " + CACHE_FACTORY_RESOURCE_PROP + " not set"); CacheManager cf = locateCacheFactory( name, NamingHelper.getJndiProperties( properties ) ); setCacheFactory( cf ); super.start(settings, properties); }
@Override public void start(Settings settings, Properties properties) throws CacheException { String name = PropertiesHelper.getString(CACHE_FACTORY_RESOURCE_PROP, properties, null); if (name == null) throw new CacheException("Configuration property " + CACHE_FACTORY_RESOURCE_PROP + " not set"); CacheManager cf = locateCacheFactory( name, NamingHelper.getJndiProperties( properties ) ); setCacheFactory( cf ); super.start(settings, properties); }