Codota Logo
ChangeInput
Code IndexAdd Codota to your IDE (free)

How to use
ChangeInput
in
com.gs.obevo.api.appdata

Best Java code snippets using com.gs.obevo.api.appdata.ChangeInput (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: com.goldmansachs.obevo/obevo-db-sybase-ase

@Override
public String handleAnySqlPostTranslation(String string, ChangeInput change) {
  if (change != null && change.getMetadataSection() != null
      && change.getMetadataSection().isTogglePresent(TextMarkupDocumentReader.TOGGLE_DISABLE_QUOTED_IDENTIFIERS)) {
    if (!change.getChangeKey().getChangeType().getName().equals(ChangeType.VIEW_STR)) {
      // only needed for HSQL seemingly for views only, seemingly not for H2
      string = string.replace('"', '\'');
    }
  }
  Matcher varbinaryDefaultMatcher = this.varbinaryDefaultPattern.matcher(string);
  if (varbinaryDefaultMatcher.find()) {
    string = varbinaryDefaultMatcher.replaceFirst("varbinary(1)" + varbinaryDefaultMatcher.group(1));
  }
  return string;
}
origin: com.goldmansachs.obevo/obevo-core

/**
 * This getDbObjectKey() string concatenation is a kludge until we refactor the DB object stuff itself out to its
 * own object
 */
public String getDbObjectKey() {
  return this.getObjectKey().getSchema() + ":" + this.getObjectName();
}
origin: com.goldmansachs.obevo/obevo-db

  @Override
  public ChangeInput valueOf(Pair<String, Integer> object) {
    String content = object.getOne();
    int index = object.getTwo();
    ChangeType changeType = getChangeType(content, defaultChangeType);
    String changeName = "baseline-change-" + index;
    boolean active = true;
    String rollbackIfAlreadyDeployedCommand = null;
    String rollbackContent = null;
    ChangeInput change = new ChangeInput(false);
    change.setChangeKey(new ChangeKey(schema, changeType, objectName, changeName));
    change.setOrder(index);
    change.setContentHash(contentHashStrategy.hashContent(content));
    change.setContent(content);
    change.setRollbackIfAlreadyDeployedContent(rollbackIfAlreadyDeployedCommand);
    change.setActive(active);
    change.setRollbackContent(rollbackContent);
    change.setFileLocation(file);
    return change;
  }
});
origin: goldmansachs/obevo

private ChangeInput create3(ChangeType changeType, String schema, String objectName, String changeName,
    int orderWithinObject, String hash, String content, String rollbackIfAlreadyDeployedContent, boolean active, ImmutableList<ArtifactRestrictions> restrictions) {
  ChangeInput changeInput = new ChangeInput(false);
  changeInput.setChangeKey(new ChangeKey(schema, changeType, objectName, changeName));
  changeInput.setOrderWithinObject(orderWithinObject);
  changeInput.setContentHash(hash);
  changeInput.setContent(content);
  changeInput.setRollbackIfAlreadyDeployedContent(rollbackIfAlreadyDeployedContent);
  changeInput.setActive(active);
  changeInput.setRestrictions(restrictions);
  return changeInput;
}
origin: goldmansachs/obevo

@Test
public void testDbChange() {
  ChangeInput change = new TableChangeParser(new EmptyContentHashStrategy(), getChangeType)
      .value(tableChangeType,
          null, "//// CHANGE name=chng5Rollback applyGrants=true INACTIVE baselinedChanges=\"a,b,c\" \nmychange\n\n// ROLLBACK-IF-ALREADY-DEPLOYED\nmyrollbackcommand\n", objectName
          , "schem", null).get(0);
  assertEquals("schem", change.getObjectKey().getSchema());
  assertEquals("chng5Rollback", change.getChangeKey().getChangeName());
  assertEquals("mychange\n", change.getContent());
  assertEquals("mychan", change.getContentHash());
  assertEquals("myrollbackcommand", change.getRollbackIfAlreadyDeployedContent());
  assertEquals(UnifiedSet.newSetWith("a", "b", "c"), change.getBaselinedChanges().toSet());
  assertFalse(change.isActive());
  assertTrue(change.getApplyGrants());
}
origin: goldmansachs/obevo

private ChangeInput create(ChangeType changeType, String schema, String objectName, String changeName,
    int orderWithinObject, String hash, String content) {
  ChangeInput changeInput = new ChangeInput(false);
  changeInput.setChangeKey(new ChangeKey(schema, changeType, objectName, changeName));
  changeInput.setOrderWithinObject(orderWithinObject);
  changeInput.setContentHash(hash);
  changeInput.setContent(content);
  return changeInput;
}
private ChangeInput create2(ChangeType changeType, String schema, String objectName, String changeName,
origin: goldmansachs/obevo

@Test
public void readFileWithBody() throws Exception {
  RerunnableChangeParser parser = new RerunnableChangeParser();
  String fileContent =
      "main\n" +
          "//// BODY\n" +
          "body content\n" +
          "";
  ChangeType mainChangeType = mock(ChangeType.class);
  ChangeType bodyChangeType = mock(ChangeType.class);
  when(mainChangeType.getBodyChangeType()).thenReturn(bodyChangeType);
  ImmutableList<ChangeInput> changes = parser.value(mainChangeType, null, fileContent, objectName, "schema", null);
  Verify.assertSize(2, changes);
  ChangeInput c1 = changes.get(0);
  assertEquals(objectName, c1.getObjectName());
  assertEquals("main", c1.getContent());
  ChangeInput c2 = changes.get(1);
  assertEquals(objectName, c2.getObjectName());
  assertEquals("body", c2.getChangeKey().getChangeName());
  assertEquals("body content", c2.getContent());
}
origin: goldmansachs/obevo

assertThat("Mismatch on row " + i + " on changeKey", changes.get(i).getChangeKey(), equalTo(expected.get(i).getChangeKey()));
assertThat("Mismatch on row " + i + " on content", changes.get(i).getContent(), equalToIgnoringWhiteSpace(expected.get(i).getContent()));
ImmutableList<ArtifactRestrictions> restrictions = expected.get(i).getRestrictions() == null ?
    Lists.immutable.of(
        new ArtifactEnvironmentRestrictions(UnifiedSet.newSetWith("q1"), UnifiedSet.<String>newSet()),
        new ArtifactPlatformRestrictions(UnifiedSet.newSetWith("DB2", "SYBASE_ASE", "HSQL"), UnifiedSet.<String>newSet())
    ) :
    expected.get(i).getRestrictions();
assertEquals(2, changes.get(i).getRestrictions().size());
assertRestrictions(ArtifactEnvironmentRestrictions.class, restrictions, changes.get(i));
assertRestrictions(ArtifactPlatformRestrictions.class, restrictions, changes.get(i));
origin: goldmansachs/obevo

@Test
public void readFileWithMetaAndDrop() throws Exception {
  RerunnableChangeParser parser = new RerunnableChangeParser();
  String fileContent = "\n" +
      "//// METADATA dependencies=\"abc,123\"\n" +
      "mycontent\n" +
      "line2\n" +
      "//// DROP_COMMAND\n" +
      "mydrop" +
      "";
  ImmutableList<ChangeInput> changes = parser.value(mock(ChangeType.class), null, fileContent, objectName, "schema", null);
  Verify.assertSize(1, changes);
  ChangeInput change = changes.get(0);
  assertEquals(objectName, change.getObjectName());
  assertEquals("mycontent\nline2", change.getContent());
  assertEquals(Sets.immutable.with(new CodeDependency("abc", CodeDependencyType.EXPLICIT), new CodeDependency("123", CodeDependencyType.EXPLICIT)), change.getCodeDependencies());
  assertEquals("mydrop", change.getDropContent());
}
origin: goldmansachs/obevo

@Override
public final String prepare(String sql, final ChangeInput change, final Environment env) {
  if (change != null && Objects.equals(change.getChangeKey().getChangeType().getName(), ChangeType.STATICDATA_STR)
      && !StaticDataChangeTypeBehavior.isInsertModeStaticData(sql)) {
    return sql;
  }
  sql = CommentRemover.removeComments(sql, change != null ? change.getChangeKey().toString() : sql);
  MutableList<String> sqls = MultiLineStringSplitter.createSplitterOnSpaceAndLine("GO").valueOf(sql);
  MutableList<String> convertedSqls = sqls.collect(new Function<String, String>() {
    @Override
    public String valueOf(String object) {
      return InMemoryTranslator.this.translateStatement(object, change);
    }
  });
  return convertedSqls.makeString("\n\nGO\n\n");
}
origin: goldmansachs/obevo

@Test
public void readSimpleFile() throws Exception {
  RerunnableChangeParser parser = new RerunnableChangeParser();
  String fileContent = "\n" +
      "mycontent" +
      "";
  ImmutableList<ChangeInput> changes = parser.value(mock(ChangeType.class), null, fileContent, objectName, "schema", null);
  Verify.assertSize(1, changes);
  ChangeInput change = changes.get(0);
  assertEquals(objectName, change.getObjectName());
  assertEquals("\nmycontent", change.getContent());
  assertEquals(null, change.getDropContent());
}
origin: goldmansachs/obevo

  @Override
  public Object valueOf(ChangeInput it) {
    return it.getObjectName();
  }
}, "MyTemplate2")));
origin: com.goldmansachs.obevo/obevo-core

public String getChangeTypeName() {
  return this.getObjectKey().getChangeTypeName();
}
origin: goldmansachs/obevo

assertThat(changes.get(0).getContent(), containsString("CREATE TABLE"));
assertThat(changes.get(1).getContent(), containsString("PRIMARY KEY"));
assertThat(changes.get(2).getContent(), containsString("CREATE INDEX"));
assertThat(changes.get(3).getContent(), containsString("ADD COLUMN"));
assertThat(changes.get(4).getContent(), containsString("FOREIGN KEY"));
origin: goldmansachs/obevo

private ChangeInput create2(ChangeType changeType, String schema, String objectName, String changeName,
    int orderWithinObject, String hash, String content, String rollbackIfAlreadyDeployedContent, boolean active) {
  ChangeInput changeInput = new ChangeInput(false);
  changeInput.setChangeKey(new ChangeKey(schema, changeType, objectName, changeName));
  changeInput.setOrderWithinObject(orderWithinObject);
  changeInput.setContentHash(hash);
  changeInput.setContent(content);
  changeInput.setRollbackIfAlreadyDeployedContent(rollbackIfAlreadyDeployedContent);
  changeInput.setActive(active);
  return changeInput;
}
private ChangeInput create3(ChangeType changeType, String schema, String objectName, String changeName,
origin: goldmansachs/obevo

@Test
public void testDbChange2DiffValues() {
  ChangeInput change = new TableChangeParser(new EmptyContentHashStrategy(), getChangeType)
      .value(tableChangeType,
          null, "//// CHANGE name=chng5Rollback INACTIVE baselinedChanges=\"a,b,c\" \nmychange\n\n// ROLLBACK-IF-ALREADY-DEPLOYED\nmyrollbackcommand\n", objectName
          , "schem", null).get(0);
  assertEquals("schem", change.getObjectKey().getSchema());
  assertEquals("chng5Rollback", change.getChangeKey().getChangeName());
  assertEquals("mychange\n", change.getContent());
  assertEquals("mychan", change.getContentHash());
  assertEquals("myrollbackcommand", change.getRollbackIfAlreadyDeployedContent());
  assertEquals(UnifiedSet.newSetWith("a", "b", "c"), change.getBaselinedChanges().toSet());
  assertFalse(change.isActive());
  assertNull(change.getApplyGrants());
}
origin: com.goldmansachs.obevo/obevo-db

@Override
public final String prepare(String sql, final ChangeInput change, final Environment env) {
  if (change != null && Objects.equals(change.getChangeKey().getChangeType().getName(), ChangeType.STATICDATA_STR)
      && !StaticDataChangeTypeBehavior.isInsertModeStaticData(sql)) {
    return sql;
  }
  sql = CommentRemover.removeComments(sql, change != null ? change.getChangeKey().toString() : sql);
  MutableList<String> sqls = MultiLineStringSplitter.createSplitterOnSpaceAndLine("GO").valueOf(sql);
  MutableList<String> convertedSqls = sqls.collect(new Function<String, String>() {
    @Override
    public String valueOf(String object) {
      return InMemoryTranslator.this.translateStatement(object, change);
    }
  });
  return convertedSqls.makeString("\n\nGO\n\n");
}
origin: goldmansachs/obevo

  @Override
  public Object valueOf(ChangeInput it) {
    return it.getObjectName();
  }
}, "MyTemplate1")));
origin: goldmansachs/obevo

public String getChangeTypeName() {
  return this.getObjectKey().getChangeTypeName();
}
origin: goldmansachs/obevo

  @Override
  public ChangeInput valueOf(Pair<String, Integer> object) {
    String content = object.getOne();
    int index = object.getTwo();
    ChangeType changeType = getChangeType(content, defaultChangeType);
    String changeName = "baseline-change-" + index;
    boolean active = true;
    String rollbackIfAlreadyDeployedCommand = null;
    String rollbackContent = null;
    ChangeInput change = new ChangeInput(false);
    change.setChangeKey(new ChangeKey(schema, changeType, objectName, changeName));
    change.setOrder(index);
    change.setContentHash(contentHashStrategy.hashContent(content));
    change.setContent(content);
    change.setRollbackIfAlreadyDeployedContent(rollbackIfAlreadyDeployedCommand);
    change.setActive(active);
    change.setRollbackContent(rollbackContent);
    change.setFileLocation(file);
    return change;
  }
});
com.gs.obevo.api.appdataChangeInput

Most used methods

  • getChangeKey
  • getObjectName
  • <init>
  • getContent
  • getMetadataSection
  • getObjectKey
  • setActive
  • setChangeKey
  • setContent
  • setContentHash
  • setRollbackIfAlreadyDeployedContent
  • getApplyGrants
  • setRollbackIfAlreadyDeployedContent,
  • getApplyGrants,
  • getBaselinedChanges,
  • getChangeTypeName,
  • getCodeDependencies,
  • getContentHash,
  • getDropContent,
  • getFileLocation,
  • getRestrictions,
  • getRollbackIfAlreadyDeployedContent

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now