mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.7.2.1'
This commit is contained in:
@@ -40,5 +40,5 @@ public class Db_qry_dml_tst {
|
||||
qry.Where_(Criteria_.And(Db_crt_.New_eq("id", 0), Db_crt_.New_mt("startTime", DateAdp_.parse_gplx("2005-01-01"))));
|
||||
tst_XtoSql(qry, "UPDATE tbl0 SET id=1, name='me', startTime='2007-12-23 00:00:00.000' WHERE (id = 0 AND startTime > '2005-01-01 00:00:00.000')");
|
||||
}
|
||||
void tst_XtoSql(Db_qry qry, String expd) {Tfds.Eq(expd, qry.To_sql__exec(gplx.dbs.sqls.Sql_qry_wtr_.Basic));}
|
||||
void tst_XtoSql(Db_qry qry, String expd) {Tfds.Eq(expd, qry.To_sql__exec(gplx.dbs.sqls.Sql_qry_wtr_.New__basic()));}
|
||||
}
|
||||
|
||||
@@ -85,5 +85,5 @@ public class Db_qry_select_tst {
|
||||
// expd = "SELECT fld0, fld1 FROM tbl0 GROUP BY fld0, fld1 HAVING Count(fld0) > 1";
|
||||
// Tfds.Eq(cmd.To_str(), expd);
|
||||
// }
|
||||
void tst_XtoStr(Db_qry qry, String expd) {Tfds.Eq(expd, cmd.To_sql__exec(Sql_qry_wtr_.Basic));}
|
||||
void tst_XtoStr(Db_qry qry, String expd) {Tfds.Eq(expd, cmd.To_sql__exec(Sql_qry_wtr_.New__basic()));}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ public class Db_qry_sql implements Db_qry {
|
||||
}
|
||||
public static Db_qry_sql as_(Object obj) {return obj instanceof Db_qry_sql ? (Db_qry_sql)obj : null;}
|
||||
public static Db_qry_sql cast(Object obj) {try {return (Db_qry_sql)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, Db_qry_sql.class, obj);}}
|
||||
public static String Gen_sql(Db_qry qry, Object... args) {
|
||||
byte[] src = Bry_.new_u8(Sql_qry_wtr_.Gen_placeholder_parameters(qry));
|
||||
public static String Gen_sql(Sql_qry_wtr qry_wtr, Db_qry qry, Object... args) {
|
||||
byte[] src = Bry_.new_u8(qry_wtr.To_sql_str(qry, true));
|
||||
int src_len = src.length;
|
||||
int args_idx = 0, args_len = args.length, pos = 0;
|
||||
Bry_bfr bfr = Bry_bfr_.New_w_size(src_len);
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.dbs.qrys; import gplx.*; import gplx.dbs.*;
|
||||
import org.junit.*;
|
||||
import org.junit.*; import gplx.dbs.sqls.*;
|
||||
public class Db_qry_sql_tst {
|
||||
@Before public void init() {fxt.Clear();} private Db_qry_sql_fxt fxt = new Db_qry_sql_fxt();
|
||||
@Test public void Insert() {
|
||||
@@ -42,6 +42,7 @@ public class Db_qry_sql_tst {
|
||||
}
|
||||
}
|
||||
class Db_qry_sql_fxt {
|
||||
private final Sql_qry_wtr qry_wtr = Sql_qry_wtr_.New__sqlite();
|
||||
public void Clear() {}
|
||||
public void Test_qry(Db_qry qry, Object[] vals, String expd) {Tfds.Eq(expd, Db_qry_sql.Gen_sql(qry, vals));}
|
||||
public void Test_qry(Db_qry qry, Object[] vals, String expd) {Tfds.Eq(expd, Db_qry_sql.Gen_sql(qry_wtr, qry, vals));}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user