Codota Logo
InsertGenKeysOp$Int.<init>
Code IndexAdd Codota to your IDE (free)

How to use
com.novarto.sanedbc.core.ops.InsertGenKeysOp$Int
constructor

Best Java code snippets using com.novarto.sanedbc.core.ops.InsertGenKeysOp$Int.<init> (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: novarto-oss/sane-dbc

public static DB<Integer> insertStuffGetKey(String description)
{
  /*
    An InsertGenKeysOp is the same as an UpdateOp, only that it expects an auto-generated key to be present
    after executing the update, and returns it as the result.
    InsertGenKeysOp.Int is a specialization which expects an Integer key
   */
  return new InsertGenKeysOp.Int(
      "INSERT INTO STUFF(DESCRIPTION) VALUES(?)",
      // you can see that the binder is the same as in the previous operation.
      // in that case it is good practice to extract it as a static final field of your module
      ps -> ps.setString(1, description)
  );
}
origin: novarto-oss/sane-dbc

@Test
public void insertGenKeys()
{
  Integer id = DB.transact(new InsertGenKeysOp.Int(
      "INSERT INTO MySqlTest_IDS(DUMMY) VALUES (?)",
      ps -> ps.setString(1, "a")));
  assertThat(id, is(notNullValue()));
  String str = DB.submit(DbOps
      .unique(new SelectOp.List<>("SELECT DUMMY FROM MySqlTest_IDS WHERE ID=?", ps -> ps.setInt(1, id),
          rs -> rs.getString(1)))).some();
  assertThat(str, is("a"));
}
com.novarto.sanedbc.core.opsInsertGenKeysOp$Int<init>

Popular methods of InsertGenKeysOp$Int

    Popular in Java

    • Making http requests using okhttp
    • getSystemService (Context)
    • getExternalFilesDir (Context)
    • putExtra (Intent)
    • FileInputStream (java.io)
      A FileInputStream obtains input bytes from a file in a file system. What files are available depends
    • IOException (java.io)
      Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
    • Pattern (java.util.regex)
      A compiled representation of a regular expression. A regular expression, specified as a string, must
    • Notification (javax.management)
    • FileUtils (org.apache.commons.io)
      General file manipulation utilities. Facilities are provided in the following areas: * writing to a
    • Loader (org.hibernate.loader)
      Abstract superclass of object loading (and querying) strategies. This class implements useful common
    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