类org.hibernate.tool.schema.spi.Exporter源码实例Demo

下面列出了怎么用org.hibernate.tool.schema.spi.Exporter的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: lams   文件: AbstractSchemaMigrator.java
protected void applyIndexes(
		Table table,
		TableInformation tableInformation,
		Dialect dialect,
		Metadata metadata,
		Formatter formatter,
		ExecutionOptions options,
		GenerationTarget... targets) {
	final Exporter<Index> exporter = dialect.getIndexExporter();

	final Iterator<Index> indexItr = table.getIndexIterator();
	while ( indexItr.hasNext() ) {
		final Index index = indexItr.next();
		if ( !StringHelper.isEmpty( index.getName() ) ) {
			IndexInformation existingIndex = null;
			if ( tableInformation != null ) {
				existingIndex = findMatchingIndex( index, tableInformation );
			}
			if ( existingIndex == null ) {
				applySqlStrings(
						false,
						exporter.getSqlCreateStrings( index, metadata ),
						formatter,
						options,
						targets
				);
			}
		}
	}
}
 
源代码2 项目: lams   文件: AbstractSchemaMigrator.java
protected void applyForeignKeys(
		Table table,
		TableInformation tableInformation,
		Dialect dialect,
		Metadata metadata,
		Formatter formatter,
		ExecutionOptions options,
		GenerationTarget... targets) {
	if ( dialect.hasAlterTable() ) {
		final Exporter<ForeignKey> exporter = dialect.getForeignKeyExporter();

		@SuppressWarnings("unchecked")
		final Iterator<ForeignKey> fkItr = table.getForeignKeyIterator();
		while ( fkItr.hasNext() ) {
			final ForeignKey foreignKey = fkItr.next();
			if ( foreignKey.isPhysicalConstraint() && foreignKey.isCreationEnabled() ) {
				boolean existingForeignKeyFound = false;
				if ( tableInformation != null ) {
					existingForeignKeyFound = checkForExistingForeignKey(
							foreignKey,
							tableInformation
					);
				}
				if ( !existingForeignKeyFound ) {
					// todo : shouldn't we just drop+recreate if FK exists?
					//		this follows the existing code from legacy SchemaUpdate which just skipped

					// in old SchemaUpdate code, this was the trigger to "create"
					applySqlStrings(
							false,
							exporter.getSqlCreateStrings( foreignKey, metadata ),
							formatter,
							options,
							targets
					);
				}
			}
		}
	}
}
 
@Override
public Exporter<Table> getTableExporter() {
  return this.spannerTableExporter;
}
 
@Override
public Exporter<ForeignKey> getForeignKeyExporter() {
  return this.spannerForeignKeyExporter;
}
 
@Override
public Exporter<Sequence> getSequenceExporter() {
  return NOOP_EXPORTER;
}
 
源代码6 项目: lams   文件: AbstractSchemaMigrator.java
protected void applyUniqueKeys(
		Table table,
		TableInformation tableInfo,
		Dialect dialect,
		Metadata metadata,
		Formatter formatter,
		ExecutionOptions options,
		GenerationTarget... targets) {
	if ( uniqueConstraintStrategy == null ) {
		uniqueConstraintStrategy = determineUniqueConstraintSchemaUpdateStrategy( metadata );
	}

	if ( uniqueConstraintStrategy != UniqueConstraintSchemaUpdateStrategy.SKIP ) {
		final Exporter<Constraint> exporter = dialect.getUniqueKeyExporter();

		final Iterator ukItr = table.getUniqueKeyIterator();
		while ( ukItr.hasNext() ) {
			final UniqueKey uniqueKey = (UniqueKey) ukItr.next();
			// Skip if index already exists. Most of the time, this
			// won't work since most Dialects use Constraints. However,
			// keep it for the few that do use Indexes.
			IndexInformation indexInfo = null;
			if ( tableInfo != null && StringHelper.isNotEmpty( uniqueKey.getName() ) ) {
				indexInfo = tableInfo.getIndex( Identifier.toIdentifier( uniqueKey.getName() ) );
			}
			if ( indexInfo == null ) {
				if ( uniqueConstraintStrategy == UniqueConstraintSchemaUpdateStrategy.DROP_RECREATE_QUIETLY ) {
					applySqlStrings(
							true,
							exporter.getSqlDropStrings( uniqueKey, metadata ),
							formatter,
							options,
							targets
					);
				}

				applySqlStrings(
						true,
						exporter.getSqlCreateStrings( uniqueKey, metadata ),
						formatter,
						options,
						targets
				);
			}
		}
	}
}
 
源代码7 项目: lams   文件: Teradata14Dialect.java
@Override
public Exporter<Index> getIndexExporter() {
	return TeraIndexExporter;
}
 
源代码8 项目: lams   文件: AbstractHANADialect.java
@Override
public Exporter<Table> getTableExporter() {
	return this.hanaTableExporter;
}
 
源代码9 项目: lams   文件: Dialect.java
public Exporter<Table> getTableExporter() {
	return tableExporter;
}
 
源代码10 项目: lams   文件: Dialect.java
public Exporter<Sequence> getSequenceExporter() {
	return sequenceExporter;
}
 
源代码11 项目: lams   文件: Dialect.java
public Exporter<Index> getIndexExporter() {
	return indexExporter;
}
 
源代码12 项目: lams   文件: Dialect.java
public Exporter<ForeignKey> getForeignKeyExporter() {
	return foreignKeyExporter;
}
 
源代码13 项目: lams   文件: Dialect.java
public Exporter<Constraint> getUniqueKeyExporter() {
	return uniqueKeyExporter;
}
 
源代码14 项目: lams   文件: Dialect.java
public Exporter<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectExporter() {
	return auxiliaryObjectExporter;
}
 
源代码15 项目: keycloak   文件: DelegatingDialect.java
@Override
public Exporter<Table> getTableExporter() {
    return getInstance().getTableExporter();
}
 
源代码16 项目: keycloak   文件: DelegatingDialect.java
@Override
public Exporter<Sequence> getSequenceExporter() {
    return getInstance().getSequenceExporter();
}
 
源代码17 项目: keycloak   文件: DelegatingDialect.java
@Override
public Exporter<Index> getIndexExporter() {
    return getInstance().getIndexExporter();
}
 
源代码18 项目: keycloak   文件: DelegatingDialect.java
@Override
public Exporter<ForeignKey> getForeignKeyExporter() {
    return getInstance().getForeignKeyExporter();
}
 
源代码19 项目: keycloak   文件: DelegatingDialect.java
@Override
public Exporter<Constraint> getUniqueKeyExporter() {
    return getInstance().getUniqueKeyExporter();
}
 
源代码20 项目: keycloak   文件: DelegatingDialect.java
@Override
public Exporter<AuxiliaryDatabaseObject> getAuxiliaryDatabaseObjectExporter() {
    return getInstance().getAuxiliaryDatabaseObjectExporter();
}
 
 类所在包
 同包方法