Tabnine Logo
SQLRouteResult.getGeneratedKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getGeneratedKey
method
in
org.apache.shardingsphere.core.routing.SQLRouteResult

Best Java code snippets using org.apache.shardingsphere.core.routing.SQLRouteResult.getGeneratedKey (Showing top 5 results out of 315)

origin: apache/incubator-shardingsphere

private Optional<GeneratedKey> getGeneratedKey() {
  if (null != routeResult && routeResult.getSqlStatement() instanceof InsertStatement) {
    return Optional.fromNullable(routeResult.getGeneratedKey());
  }
  return Optional.absent();
}

origin: apache/incubator-shardingsphere

  private Optional<GeneratedKey> getGeneratedKey() {
    if (null != routeResult && routeResult.getSqlStatement() instanceof InsertStatement) {
      return Optional.fromNullable(routeResult.getGeneratedKey());
    }
    return Optional.absent();
  }
}
origin: apache/incubator-shardingsphere

private void setGeneratedKeys(final SQLRouteResult sqlRouteResult, final GeneratedKey generatedKey) {
  generatedKeys.addAll(generatedKey.getGeneratedKeys());
  sqlRouteResult.getGeneratedKey().getGeneratedKeys().clear();
  sqlRouteResult.getGeneratedKey().getGeneratedKeys().addAll(generatedKeys);
}

origin: apache/incubator-shardingsphere

@Override
public ResultSet getGeneratedKeys() throws SQLException {
  Optional<GeneratedKey> generatedKey = getGeneratedKey();
  if (returnGeneratedKeys && generatedKey.isPresent()) {
    return new GeneratedKeysResultSet(routeResult.getGeneratedKey().getGeneratedKeys().iterator(), generatedKey.get().getColumn().getName(), this);
  }
  if (1 == getRoutedStatements().size()) {
    return getRoutedStatements().iterator().next().getGeneratedKeys();
  }
  return new GeneratedKeysResultSet();
}

origin: apache/incubator-shardingsphere

@Override
public ResultSet getGeneratedKeys() throws SQLException {
  Optional<GeneratedKey> generatedKey = getGeneratedKey();
  if (preparedStatementExecutor.isReturnGeneratedKeys() && generatedKey.isPresent()) {
    return new GeneratedKeysResultSet(routeResult.getGeneratedKey().getGeneratedKeys().iterator(), generatedKey.get().getColumn().getName(), this);
  }
  if (1 == preparedStatementExecutor.getStatements().size()) {
    return preparedStatementExecutor.getStatements().iterator().next().getGeneratedKeys();
  }
  return new GeneratedKeysResultSet();
}

org.apache.shardingsphere.core.routingSQLRouteResultgetGeneratedKey

Popular methods of SQLRouteResult

  • getRouteUnits
  • getSqlStatement
  • <init>

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now