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


Java JdbcServices类代码示例

本文整理汇总了Java中org.hibernate.engine.jdbc.spi.JdbcServices的典型用法代码示例。如果您正苦于以下问题:Java JdbcServices类的具体用法?Java JdbcServices怎么用?Java JdbcServices使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: applyRelationalConstraints

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
@SuppressWarnings({"unchecked", "UnusedParameters"})
private static void applyRelationalConstraints(ValidatorFactory factory, ActivationContext activationContext) {
	final Properties properties = activationContext.getConfiguration().getProperties();
	if ( ! ConfigurationHelper.getBoolean( BeanValidationIntegrator.APPLY_CONSTRAINTS, properties, true ) ){
		LOG.debug( "Skipping application of relational constraints from legacy Hibernate Validator" );
		return;
	}

	final Set<ValidationMode> modes = activationContext.getValidationModes();
	if ( ! ( modes.contains( ValidationMode.DDL ) || modes.contains( ValidationMode.AUTO ) ) ) {
		return;
	}

	applyRelationalConstraints(
			factory,
			activationContext.getConfiguration().createMappings().getClasses().values(),
			properties,
			activationContext.getServiceRegistry().getService( JdbcServices.class ).getDialect()
	);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:21,代码来源:TypeSafeActivator.java

示例2: SchemaExport

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的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

示例3: LogicalConnectionImpl

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
/**
 * Constructs a LogicalConnectionImpl
 *
 * @param userSuppliedConnection The user-supplied connection
 * @param connectionReleaseMode The connection release mode to use
 * @param jdbcServices JdbcServices
 * @param jdbcConnectionAccess JDBC Connection access
 */
public LogicalConnectionImpl(
		Connection userSuppliedConnection,
		ConnectionReleaseMode connectionReleaseMode,
		JdbcServices jdbcServices,
		JdbcConnectionAccess jdbcConnectionAccess) {
	this(
			connectionReleaseMode,
			jdbcServices,
			jdbcConnectionAccess,
			(userSuppliedConnection != null),
			false,
			new ArrayList<ConnectionObserver>()
	);
	this.physicalConnection = userSuppliedConnection;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:24,代码来源:LogicalConnectionImpl.java

示例4: execute

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
@Override
public void execute(Connection connection) {
	try {
		Statement statement = connection.createStatement();
		try {
			statement.executeUpdate( persister.getTemporaryIdTableDDL() );
			persister.getFactory()
					.getServiceRegistry()
					.getService( JdbcServices.class )
					.getSqlExceptionHelper()
					.handleAndClearWarnings( statement, CREATION_WARNING_HANDLER );
		}
		finally {
			try {
				statement.close();
			}
			catch( Throwable ignore ) {
				// ignore
			}
		}
	}
	catch( Exception e ) {
		log.debug( "unable to create temporary id table [" + e.getMessage() + "]" );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:26,代码来源:TemporaryTableBulkIdStrategy.java

示例5: execute

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
@Override
public void execute(Connection connection) {
    try {
        Statement statement = connection.createStatement();
        try {
            statement.executeUpdate( persister.getTemporaryIdTableDDL() );
            persister.getFactory()
                    .getServiceRegistry()
                    .getService( JdbcServices.class )
                    .getSqlExceptionHelper()
                    .handleAndClearWarnings( statement, CREATION_WARNING_HANDLER );
        }
        finally {
            try {
                statement.close();
            }
            catch( Throwable ignore ) {
                // ignore
            }
        }
    }
    catch( Exception e ) {
        log.debug( "unable to create temporary id table [" + e.getMessage() + "]" );
    }
}
 
开发者ID:windup,项目名称:windup-rulesets,代码行数:26,代码来源:CustomBuildIdDelegate.java

示例6: convertSqlException

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
protected JDBCException convertSqlException(String message, SQLException e) {
	// if JdbcServices#getSqlExceptionHelper is available, use it...
	final JdbcServices jdbcServices = serviceRegistry.getService( JdbcServices.class );
	if ( jdbcServices != null && jdbcServices.getSqlExceptionHelper() != null ) {
		return jdbcServices.getSqlExceptionHelper().convert( e, message, null );
	}

	// likely we are still in the process of initializing the ServiceRegistry, so use the simplified
	// SQLException conversion
	return simpleConverterAccess.getValue().convert( e, message, null );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:BasicConnectionCreator.java

示例7: ResultSetReturnImpl

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
/**
 * Constructs a ResultSetReturnImpl
 *
 * @param jdbcCoordinator The JdbcCoordinator
 */
public ResultSetReturnImpl(JdbcCoordinator jdbcCoordinator) {
	this.jdbcCoordinator = jdbcCoordinator;

	final JdbcServices jdbcServices = jdbcCoordinator.getTransactionCoordinator().getTransactionContext()
			.getTransactionEnvironment()
			.getJdbcServices();

	this.dialect = jdbcServices.getDialect();
	this.sqlStatementLogger = jdbcServices.getSqlStatementLogger();
	this.sqlExceptionHelper = jdbcServices.getSqlExceptionHelper();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:ResultSetReturnImpl.java

示例8: AbstractBatchImpl

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
protected AbstractBatchImpl(BatchKey key, JdbcCoordinator jdbcCoordinator) {
	if ( key == null ) {
		throw new IllegalArgumentException( "batch key cannot be null" );
	}
	if ( jdbcCoordinator == null ) {
		throw new IllegalArgumentException( "JDBC coordinator cannot be null" );
	}
	this.key = key;
	this.jdbcCoordinator = jdbcCoordinator;

	this.transactionContext = jdbcCoordinator.getTransactionCoordinator().getTransactionContext();
	final JdbcServices jdbcServices = transactionContext.getTransactionEnvironment().getJdbcServices();
	this.sqlStatementLogger = jdbcServices.getSqlStatementLogger();
	this.sqlExceptionHelper = jdbcServices.getSqlExceptionHelper();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:AbstractBatchImpl.java

示例9: TransactionEnvironmentImpl

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
public TransactionEnvironmentImpl(SessionFactoryImpl sessionFactory) {
    this.sessionFactory = sessionFactory;
    this.statisticsImplementor = sessionFactory.getStatisticsImplementor();
    this.serviceRegistry = sessionFactory.getServiceRegistry();
    this.jdbcServices = serviceRegistry.getService( JdbcServices.class );
    this.jtaPlatform = serviceRegistry.getService( JtaPlatform.class );
    this.transactionFactory = serviceRegistry.getService( TransactionFactory.class );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:TransactionEnvironmentImpl.java

示例10: prepare

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的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: checkEntityManagerFactoryConfiguration

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
public static void checkEntityManagerFactoryConfiguration(EntityManagerFactory entityManagerFactory) {
    try {
        SessionFactoryImpl sessionFactoryImpl = entityManagerFactory.unwrap(SessionFactoryImpl.class);
        if (PostgreSQL9Dialect.class
            .isInstance(sessionFactoryImpl.getServiceRegistry().getService(JdbcServices.class).getDialect())) {
            //fix ClassLeftUnique and ClassRightUnique, as PostgreSQL cannot evaluate them on statement level
            modifyConstraints(sessionFactoryImpl);
        }
    } catch (PersistenceException e) {
        LogManager.getLogger()
            .warn("Unsupported EntityManagerFactory found: {}", entityManagerFactory.getClass().getName());
    }
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:14,代码来源:MCRHibernateConfigHelper.java

示例12: prepare

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
@Override
public void prepare(JdbcServices jdbcServices, JdbcConnectionAccess connectionAccess, MetadataImplementor metadata, SessionFactoryOptions sessionFactoryOptions) {
    ConfigurationService configService = sessionFactoryOptions.getServiceRegistry().getService(ConfigurationService.class);
    this.fullyQualifiedTableName = Objects.requireNonNull(configService.getSetting(TABLE, String.class, null), "Property " + TABLE + " must be set.");
    this.idColumn = configService.getSetting(ID_COLUMN, String.class, "ID");
    this.discriminatorColumn = configService.getSetting(DISCRIMINATOR_COLUMN, String.class, "ENTITY_NAME");
    this.cleanRows = configService.getSetting(CLEAN_ROWS, StandardConverters.BOOLEAN, false);
}
 
开发者ID:grimsa,项目名称:hibernate-single-table-bulk-id-strategy,代码行数:9,代码来源:SingleGlobalTemporaryTableBulkIdStrategy.java

示例13: prepare

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
@Override
public void prepare(
		JdbcServices jdbcServices,
		JdbcConnectionAccess jdbcConnectionAccess,
		MetadataImplementor metadataImplementor,
		SessionFactoryOptions sessionFactoryOptions) {

}
 
开发者ID:epiresdasilva,项目名称:cte-multi-table-bulk-id-stategy,代码行数:9,代码来源:CTEMultiTableBulkIdStrategy.java

示例14: DbOpenHelper

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
public DbOpenHelper(ServiceRegistry serviceRegistry) throws HibernateException {
    final JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
    connectionHelper = new SuppliedConnectionProviderConnectionHelper(jdbcServices.getConnectionProvider());

    sqlStatementLogger = jdbcServices.getSqlStatementLogger();
    formatter = (sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE).getFormatter();
}
 
开发者ID:sismics,项目名称:books,代码行数:8,代码来源:DbOpenHelper.java

示例15: generateIncrementally

import org.hibernate.engine.jdbc.spi.JdbcServices; //导入依赖的package包/类
/**
    * Updates (or inserts) table column value with existing id
    * 
    * @param session
    * @param currentValue
    * @return {@link Serializable}
    */
   public Serializable generateIncrementally(final SessionImplementor session,
    final long currentValue) {

final SqlStatementLogger statementLogger = session.getFactory()
	.getServiceRegistry().getService(JdbcServices.class)
	.getSqlStatementLogger();
final AccessCallback callback = new AccessCallbackImpl(session,
	currentValue, statementLogger);

return optimizer.generate(callback);
   }
 
开发者ID:levants,项目名称:lightmare,代码行数:19,代码来源:TableGeneratorExt.java


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