• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java PlaceholderReplacer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Slime类代码示例发布时间:2022-05-15
下一篇:
Java Namespace类代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap