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