本文整理汇总了Java中org.flywaydb.core.internal.util.PlaceholderReplacer类的典型用法代码示例。如果您正苦于以下问题:Java PlaceholderReplacer类的具体用法?Java PlaceholderReplacer怎么用?Java PlaceholderReplacer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlaceholderReplacer类属于org.flywaydb.core.internal.util包,在下文中一共展示了PlaceholderReplacer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: FlywaySchemaInitializer
import org.flywaydb.core.internal.util.PlaceholderReplacer; //导入依赖的package包/类
/**
* Creates a new instance of flyway schema initializer.
*
* @param scriptsLocations the locations where to search migration scripts, if locations is not
* prefixed or prefixed with <i>classpath:</i> then initializer will try to find scripts in
* classpath using {@code Thread.currentThread().}{@link Thread#getContextClassLoader()
* getContextClassLoader()}
* @param scriptsPrefix prefix of migration scripts e.g. 'v' or empty string
* @param scriptsSuffix suffix of migration scripts e.g. '.sql'
* @param versionSeparator separate version from the other part of script name e.g. '.' or '__'
* @param baselineOnMigrate whether to ignore scripts up to the version configured by {@code
* baselineVersion}
* @param baselineVersion up to this version all the scripts ignored, unless schema is initialized
* first time, note that scripts with version equal to baseline version are also ignored
* @param dataSource data source used for migrations
* @param placeholderReplacer used to replace variables in script with configured values
*/
@Inject
public FlywaySchemaInitializer(
@Named("db.schema.flyway.scripts.locations") String[] scriptsLocations,
@Named("db.schema.flyway.scripts.prefix") String scriptsPrefix,
@Named("db.schema.flyway.scripts.suffix") String scriptsSuffix,
@Named("db.schema.flyway.scripts.version_separator") String versionSeparator,
@Named("db.schema.flyway.baseline.enabled") boolean baselineOnMigrate,
@Named("db.schema.flyway.baseline.version") String baselineVersion,
DataSource dataSource,
PlaceholderReplacer placeholderReplacer) {
this.dataSource = dataSource;
this.locations = scriptsLocations;
this.scriptsPrefix = scriptsPrefix;
this.scriptsSuffix = scriptsSuffix;
this.versionSeparator = versionSeparator;
this.baselineOnMigrate = baselineOnMigrate;
this.baselineVersion = baselineVersion;
this.placeholderReplacer = placeholderReplacer;
}
开发者ID:eclipse,项目名称:che,代码行数:37,代码来源:FlywaySchemaInitializer.java
示例2: CustomSqlMigrationResolver
import org.flywaydb.core.internal.util.PlaceholderReplacer; //导入依赖的package包/类
public CustomSqlMigrationResolver(
String dbProviderName, DbSupport dbSupport, PlaceholderReplacer placeholderReplacer) {
this.vendorName = dbProviderName;
this.dbSupport = dbSupport;
this.placeholderReplacer = placeholderReplacer;
this.finder = new ResourcesFinder();
this.versionResolver = new VersionResolver();
this.scriptsCreator = new SqlScriptCreator();
}
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:CustomSqlMigrationResolver.java
示例3: replacesVariablesWhenPlaceholderReplacerIsConfigured
import org.flywaydb.core.internal.util.PlaceholderReplacer; //导入依赖的package包/类
@Test
public void replacesVariablesWhenPlaceholderReplacerIsConfigured() throws Exception {
createScript(
"1.0/1__init.sql",
"CREATE TABLE test (id INT, text TEXT, PRIMARY KEY (id));"
+ "INSERT INTO test VALUES(1, '${variable}');");
FlywayInitializerBuilder.from(dataSource)
.setReplacer(new PlaceholderReplacer(ImmutableMap.of("variable", "test"), "${", "}"))
.build()
.init();
assertEquals(queryEntities(), Sets.newHashSet(new TestEntity(1, "test")));
}
开发者ID:eclipse,项目名称:che,代码行数:15,代码来源:FlywaySchemaInitializerTest.java
示例4: from
import org.flywaydb.core.internal.util.PlaceholderReplacer; //导入依赖的package包/类
public static FlywayInitializerBuilder from(DataSource dataSource) {
try {
final String scriptsRoot = targetDir().resolve(Paths.get(SCRIPTS_ROOT)).toString();
return new FlywayInitializerBuilder()
.setDataSource(dataSource)
.setScriptsPrefix("")
.setScriptsSuffix(".sql")
.setVersionSeparator("__")
.setReplacer(PlaceholderReplacer.NO_PLACEHOLDERS)
.setBaselineOnMigrate(false)
.addLocation("filesystem:" + scriptsRoot);
} catch (Exception x) {
throw new RuntimeException(x.getMessage(), x);
}
}
开发者ID:eclipse,项目名称:che,代码行数:16,代码来源:FlywaySchemaInitializerTest.java
示例5: createPlaceholderReplacer
import org.flywaydb.core.internal.util.PlaceholderReplacer; //导入依赖的package包/类
private static PlaceholderReplacer createPlaceholderReplacer(Flyway flyway) {
if (flyway.isPlaceholderReplacement()) {
return new PlaceholderReplacer(flyway.getPlaceholders(), flyway.getPlaceholderPrefix(), flyway.getPlaceholderSuffix());
}
return PlaceholderReplacer.NO_PLACEHOLDERS;
}
开发者ID:zonkyio,项目名称:embedded-database-spring-test,代码行数:7,代码来源:OptimizedFlywayTestExecutionListener.java
示例6: PlaceholderReplacerProvider
import org.flywaydb.core.internal.util.PlaceholderReplacer; //导入依赖的package包/类
@Inject
public PlaceholderReplacerProvider(ConfigurationProperties properties) {
replacer = new PlaceholderReplacer(properties.getProperties(".*"), "${", "}");
}
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:PlaceholderReplacerProvider.java
示例7: get
import org.flywaydb.core.internal.util.PlaceholderReplacer; //导入依赖的package包/类
@Override
public PlaceholderReplacer get() {
return replacer;
}
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:PlaceholderReplacerProvider.java
示例8: setReplacer
import org.flywaydb.core.internal.util.PlaceholderReplacer; //导入依赖的package包/类
public FlywayInitializerBuilder setReplacer(PlaceholderReplacer replacer) {
this.replacer = replacer;
return this;
}
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:FlywaySchemaInitializerTest.java
注:本文中的org.flywaydb.core.internal.util.PlaceholderReplacer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论