当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationHelper.getString方法代码示例

本文整理汇总了Java中org.hibernate.internal.util.config.ConfigurationHelper.getString方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationHelper.getString方法的具体用法?Java ConfigurationHelper.getString怎么用?Java ConfigurationHelper.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.hibernate.internal.util.config.ConfigurationHelper的用法示例。


在下文中一共展示了ConfigurationHelper.getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SchemaExport

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
public SchemaExport(ServiceRegistry serviceRegistry, Configuration configuration) {
	this.connectionHelper = new SuppliedConnectionProviderConnectionHelper(
			serviceRegistry.getService( ConnectionProvider.class )
	);
	this.sqlStatementLogger = serviceRegistry.getService( JdbcServices.class ).getSqlStatementLogger();
	this.formatter = ( sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE ).getFormatter();
	this.sqlExceptionHelper = serviceRegistry.getService( JdbcServices.class ).getSqlExceptionHelper();

	this.importFiles = ConfigurationHelper.getString(
			AvailableSettings.HBM2DDL_IMPORT_FILES,
			configuration.getProperties(),
			DEFAULT_IMPORT_FILE
	);

	final Dialect dialect = serviceRegistry.getService( JdbcServices.class ).getDialect();
	this.dropSQL = configuration.generateDropSchemaScript( dialect );
	this.createSQL = configuration.generateSchemaCreationScript( dialect );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:SchemaExport.java

示例2: determineSequenceName

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
/**
 * Determine the name of the sequence (or table if this resolves to a physical table)
 * to use.
 * <p/>
 * Called during {@link #configure configuration}.
 *
 * @param params The params supplied in the generator config (plus some standard useful extras).
 * @param dialect The dialect in effect
 * @return The sequence name
 */
protected String determineSequenceName(Properties params, Dialect dialect) {
	final String sequencePerEntitySuffix = ConfigurationHelper.getString( CONFIG_SEQUENCE_PER_ENTITY_SUFFIX, params, DEF_SEQUENCE_SUFFIX );
	// JPA_ENTITY_NAME value honors <class ... entity-name="..."> (HBM) and @Entity#name (JPA) overrides.
	String sequenceName = ConfigurationHelper.getBoolean( CONFIG_PREFER_SEQUENCE_PER_ENTITY, params, false )
			? params.getProperty( JPA_ENTITY_NAME ) + sequencePerEntitySuffix
			: DEF_SEQUENCE_NAME;
	final ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( IDENTIFIER_NORMALIZER );
	sequenceName = ConfigurationHelper.getString( SEQUENCE_PARAM, params, sequenceName );
	if ( sequenceName.indexOf( '.' ) < 0 ) {
		sequenceName = normalizer.normalizeIdentifierQuoting( sequenceName );
		final String schemaName = params.getProperty( SCHEMA );
		final String catalogName = params.getProperty( CATALOG );
		sequenceName = Table.qualify(
				dialect.quote( catalogName ),
				dialect.quote( schemaName ),
				dialect.quote( sequenceName )
		);
	}
	// if already qualified there is not much we can do in a portable manner so we pass it
	// through and assume the user has set up the name correctly.

	return sequenceName;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:34,代码来源:SequenceStyleGenerator.java

示例3: determineGeneratorTableName

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
/**
 * Determine the table name to use for the generator values.
 * <p/>
 * Called during {@link #configure configuration}.
 *
 * @see #getTableName()
 * @param params The params supplied in the generator config (plus some standard useful extras).
 * @param dialect The dialect in effect
 * @return The table name to use.
 */
protected String determineGeneratorTableName(Properties params, Dialect dialect) {
	String name = ConfigurationHelper.getString( TABLE_PARAM, params, DEF_TABLE );
	final boolean isGivenNameUnqualified = name.indexOf( '.' ) < 0;
	if ( isGivenNameUnqualified ) {
		final ObjectNameNormalizer normalizer = (ObjectNameNormalizer) params.get( IDENTIFIER_NORMALIZER );
		name = normalizer.normalizeIdentifierQuoting( name );
		// if the given name is un-qualified we may neen to qualify it
		final String schemaName = normalizer.normalizeIdentifierQuoting( params.getProperty( SCHEMA ) );
		final String catalogName = normalizer.normalizeIdentifierQuoting( params.getProperty( CATALOG ) );
		name = Table.qualify(
				dialect.quote( catalogName ),
				dialect.quote( schemaName ),
				dialect.quote( name)
		);
	}
	// if already qualified there is not much we can do in a portable manner so we pass it
	// through and assume the user has set up the name correctly.

	return name;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:TableGenerator.java

示例4: createQueryCacheFactory

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
protected QueryCacheFactory createQueryCacheFactory(Properties properties, ServiceRegistry serviceRegistry) {
	String queryCacheFactoryClassName = ConfigurationHelper.getString(
			AvailableSettings.QUERY_CACHE_FACTORY, properties, StandardQueryCacheFactory.class.getName()
	);
	LOG.debugf( "Query cache factory: %s", queryCacheFactoryClassName );
	try {
		return (QueryCacheFactory) serviceRegistry.getService( ClassLoaderService.class )
				.classForName( queryCacheFactoryClassName )
				.newInstance();
	}
	catch (Exception e) {
		throw new HibernateException( "could not instantiate QueryCacheFactory: " + queryCacheFactoryClassName, e );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:SettingsFactory.java

示例5: createQueryTranslatorFactory

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
protected QueryTranslatorFactory createQueryTranslatorFactory(Properties properties, ServiceRegistry serviceRegistry) {
	String className = ConfigurationHelper.getString(
			AvailableSettings.QUERY_TRANSLATOR, properties, "org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory"
	);
	LOG.debugf( "Query translator: %s", className );
	try {
		return (QueryTranslatorFactory) serviceRegistry.getService( ClassLoaderService.class )
				.classForName( className )
				.newInstance();
	}
	catch ( Exception e ) {
		throw new HibernateException( "could not instantiate QueryTranslatorFactory: " + className, e );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:SettingsFactory.java

示例6: JmxServiceImpl

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
public JmxServiceImpl(Map configValues) {
	usePlatformServer = ConfigurationHelper.getBoolean( AvailableSettings.JMX_PLATFORM_SERVER, configValues );
	agentId = (String) configValues.get( AvailableSettings.JMX_AGENT_ID );
	defaultDomain = (String) configValues.get( AvailableSettings.JMX_DOMAIN_NAME );
	sessionFactoryName = ConfigurationHelper.getString(
			AvailableSettings.JMX_SF_NAME,
			configValues,
			ConfigurationHelper.getString( Environment.SESSION_FACTORY_NAME, configValues )
	);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:JmxServiceImpl.java

示例7: determineOptimizationStrategy

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
/**
 * Determine the optimizer to use.
 * <p/>
 * Called during {@link #configure configuration}.
 *
 * @param params The params supplied in the generator config (plus some standard useful extras).
 * @param incrementSize The {@link #determineIncrementSize determined increment size}
 * @return The optimizer strategy (name)
 */
protected String determineOptimizationStrategy(Properties params, int incrementSize) {
	// if the increment size is greater than one, we prefer pooled optimization; but we first
	// need to see if the user prefers POOL or POOL_LO...
	final String defaultPooledOptimizerStrategy = ConfigurationHelper.getBoolean( Environment.PREFER_POOLED_VALUES_LO, params, false )
			? StandardOptimizerDescriptor.POOLED_LO.getExternalName()
			: StandardOptimizerDescriptor.POOLED.getExternalName();
	final String defaultOptimizerStrategy = incrementSize <= 1
			? StandardOptimizerDescriptor.NONE.getExternalName()
			: defaultPooledOptimizerStrategy;
	return ConfigurationHelper.getString( OPT_PARAM, params, defaultOptimizerStrategy );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:SequenceStyleGenerator.java

示例8: configure

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
@Override
public void configure(Type type, Properties params, Dialect dialect) throws MappingException {
	identifierType = type;

	tableName = determineGeneratorTableName( params, dialect );
	segmentColumnName = determineSegmentColumnName( params, dialect );
	valueColumnName = determineValueColumnName( params, dialect );

	segmentValue = determineSegmentValue( params );

	segmentValueLength = determineSegmentColumnSize( params );
	initialValue = determineInitialValue( params );
	incrementSize = determineIncrementSize( params );

	this.selectQuery = buildSelectQuery( dialect );
	this.updateQuery = buildUpdateQuery();
	this.insertQuery = buildInsertQuery();

	// if the increment size is greater than one, we prefer pooled optimization; but we
	// need to see if the user prefers POOL or POOL_LO...
	final String defaultPooledOptimizerStrategy = ConfigurationHelper.getBoolean( Environment.PREFER_POOLED_VALUES_LO, params, false )
			? StandardOptimizerDescriptor.POOLED_LO.getExternalName()
			: StandardOptimizerDescriptor.POOLED.getExternalName();
	final String defaultOptimizerStrategy = incrementSize <= 1
			? StandardOptimizerDescriptor.NONE.getExternalName()
			: defaultPooledOptimizerStrategy;
	final String optimizationStrategy = ConfigurationHelper.getString( OPT_PARAM, params, defaultOptimizerStrategy );
	optimizer = OptimizerFactory.buildOptimizer(
			optimizationStrategy,
			identifierType.getReturnedClass(),
			incrementSize,
			ConfigurationHelper.getInt( INITIAL_PARAM, params, -1 )
	);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:35,代码来源:TableGenerator.java

示例9: configure

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
public void configure(Type type, Properties params, Dialect dialect) {
	identifierType = type;

	ObjectNameNormalizer normalizer = ( ObjectNameNormalizer ) params.get( IDENTIFIER_NORMALIZER );

	tableName = ConfigurationHelper.getString( TABLE, params, DEFAULT_TABLE_NAME );
	if ( tableName.indexOf( '.' ) < 0 ) {
		final String schemaName = normalizer.normalizeIdentifierQuoting( params.getProperty( SCHEMA ) );
		final String catalogName = normalizer.normalizeIdentifierQuoting( params.getProperty( CATALOG ) );
		tableName = Table.qualify(
				dialect.quote( catalogName ),
				dialect.quote( schemaName ),
				dialect.quote( tableName )
		);
	}
	else {
		// if already qualified there is not much we can do in a portable manner so we pass it
		// through and assume the user has set up the name correctly.
	}

	columnName = dialect.quote(
			normalizer.normalizeIdentifierQuoting(
					ConfigurationHelper.getString( COLUMN, params, DEFAULT_COLUMN_NAME )
			)
	);

	query = "select " +
		columnName +
		" from " +
		dialect.appendLockHint(LockMode.PESSIMISTIC_WRITE, tableName) +
		dialect.getForUpdateString();

	update = "update " +
		tableName +
		" set " +
		columnName +
		" = ? where " +
		columnName +
		" = ?";
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:41,代码来源:TableGenerator.java

示例10: prepare

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
@Override
public void prepare(
		JdbcServices jdbcServices,
		JdbcConnectionAccess connectionAccess,
		Mappings mappings,
		Mapping mapping,
		Map settings) {
	this.catalog = ConfigurationHelper.getString(
			CATALOG,
			settings,
			ConfigurationHelper.getString( AvailableSettings.DEFAULT_CATALOG, settings )
	);
	this.schema = ConfigurationHelper.getString(
			SCHEMA,
			settings,
			ConfigurationHelper.getString( AvailableSettings.DEFAULT_SCHEMA, settings )
	);
	this.cleanUpTables = ConfigurationHelper.getBoolean( CLEAN_UP_ID_TABLES, settings, false );

	final Iterator<PersistentClass> entityMappings = mappings.iterateClasses();
	final List<Table> idTableDefinitions = new ArrayList<Table>();
	while ( entityMappings.hasNext() ) {
		final PersistentClass entityMapping = entityMappings.next();
		final Table idTableDefinition = generateIdTableDefinition( entityMapping );
		idTableDefinitions.add( idTableDefinition );
	}
	exportTableDefinitions( idTableDefinitions, jdbcServices, connectionAccess, mappings, mapping );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:29,代码来源:PersistentTableBulkIdStrategy.java

示例11: getConfigFilePath

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
public static String getConfigFilePath(final Properties props) {
    String configResourcePath = ConfigurationHelper.getString(CacheEnvironment.CONFIG_FILE_PATH_LEGACY, props, null);
    if (StringHelper.isEmpty(configResourcePath)) {
        configResourcePath = ConfigurationHelper.getString(CacheEnvironment.CONFIG_FILE_PATH, props, null);
    }
    return configResourcePath;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:8,代码来源:CacheEnvironment.java

示例12: getConfigFilePath

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
public static String getConfigFilePath(Properties props) {
    String configResourcePath = ConfigurationHelper.getString(CacheEnvironment.CONFIG_FILE_PATH_LEGACY, props, null);
    if (StringHelper.isEmpty(configResourcePath)) {
        configResourcePath = ConfigurationHelper.getString(CacheEnvironment.CONFIG_FILE_PATH, props, null);
    }
    return configResourcePath;
}
 
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:8,代码来源:CacheEnvironment.java

示例13: configure

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 * <p/>
 * Configuration of the Sequence Mapping.
 */
@Override
public void configure(Type type, Properties params, Dialect dialect)
        throws MappingException {
    this.dialect = dialect;
    // This is only used during Database creation, which is only used in test
    String table = ConfigurationHelper.getString("target_table", params, "TABLE");
    sequenceName = table + "_seq_id";
}
 
开发者ID:jaschenk,项目名称:jeffaschenk-commons,代码行数:14,代码来源:PlatformSequenceGenerator.java

示例14: buildBytecodeProvider

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
public static BytecodeProvider buildBytecodeProvider(Properties properties) {
	String provider = ConfigurationHelper.getString( BYTECODE_PROVIDER, properties, "javassist" );
	LOG.bytecodeProvider( provider );
	return buildBytecodeProvider( provider );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:Environment.java

示例15: configure

import org.hibernate.internal.util.config.ConfigurationHelper; //导入方法依赖的package包/类
public void configure(Type type, Properties params, Dialect dialect) throws MappingException {
	ObjectNameNormalizer normalizer = ( ObjectNameNormalizer ) params.get( IDENTIFIER_NORMALIZER );

	tableName = normalizer.normalizeIdentifierQuoting( ConfigurationHelper.getString( ID_TABLE, params, DEFAULT_TABLE ) );
	if ( tableName.indexOf( '.' ) < 0 ) {
		tableName = dialect.quote( tableName );
		final String schemaName = dialect.quote(
				normalizer.normalizeIdentifierQuoting( params.getProperty( SCHEMA ) )
		);
		final String catalogName = dialect.quote(
				normalizer.normalizeIdentifierQuoting( params.getProperty( CATALOG ) )
		);
		tableName = Table.qualify( catalogName, schemaName, tableName );
	}
	else {
		// if already qualified there is not much we can do in a portable manner so we pass it
		// through and assume the user has set up the name correctly.
	}

	pkColumnName = dialect.quote(
			normalizer.normalizeIdentifierQuoting(
					ConfigurationHelper.getString( PK_COLUMN_NAME, params, DEFAULT_PK_COLUMN )
			)
	);
	valueColumnName = dialect.quote(
			normalizer.normalizeIdentifierQuoting(
					ConfigurationHelper.getString( VALUE_COLUMN_NAME, params, DEFAULT_VALUE_COLUMN )
			)
	);
	keySize = ConfigurationHelper.getInt(PK_LENGTH_NAME, params, DEFAULT_PK_LENGTH);
	String keyValue = ConfigurationHelper.getString(PK_VALUE_NAME, params, params.getProperty(TABLE) );

	query = "select " +
		valueColumnName +
		" from " +
		dialect.appendLockHint( LockMode.PESSIMISTIC_WRITE, tableName ) +
		" where " + pkColumnName + " = '" + keyValue + "'" +
		dialect.getForUpdateString();

	update = "update " +
		tableName +
		" set " +
		valueColumnName +
		" = ? where " +
		valueColumnName +
		" = ? and " +
		pkColumnName +
		" = '" +
		keyValue
		+ "'";

	insert = "insert into " + tableName +
		"(" + pkColumnName + ", " +	valueColumnName + ") " +
		"values('"+ keyValue +"', ?)";


	//hilo config
	maxLo = ConfigurationHelper.getInt(MAX_LO, params, Short.MAX_VALUE);
	returnClass = type.getReturnedClass();

	if ( maxLo >= 1 ) {
		hiloOptimizer = new LegacyHiLoAlgorithmOptimizer( returnClass, maxLo );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:65,代码来源:MultipleHiLoPerTableGenerator.java


注:本文中的org.hibernate.internal.util.config.ConfigurationHelper.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。