Exemplo n.º 1
0
 @Test
 public void replaceMultipleBindsTest() {
   SqlCommand sqlCmd = new SqlCommand("UPDATE USERS SET USER = '******' WHERE USER = '******';");
   sqlCmd.setBind(":1", "USER1");
   sqlCmd.setBind(":2", "USER2");
   assertEquals("UPDATE USERS SET USER = '******' WHERE USER = '******';", sqlCmd.generateSql());
 }
Exemplo n.º 2
0
 @Test
 public void replaceSameBindMultipleTimesTest() {
   SqlCommand sqlCmd =
       new SqlCommand("SELECT * FROM USERS WHERE (USER = '******' OR MANAGER_USER = '******');");
   sqlCmd.setBind(":1", "USER1");
   assertEquals(
       "SELECT * FROM USERS WHERE (USER = '******' OR MANAGER_USER = '******');",
       sqlCmd.generateSql());
 }
Exemplo n.º 3
0
 @Test
 public void replaceSingleBindTest() {
   SqlCommand sqlCmd = new SqlCommand("DELETE FROM USERS WHERE USER = '******';");
   sqlCmd.setBind(":1", "BindOne");
   assertEquals("DELETE FROM USERS WHERE USER = '******';", sqlCmd.generateSql());
 }