mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v3.2.1.1
This commit is contained in:
@@ -51,79 +51,79 @@ class CrudOpsFxt {
|
||||
}
|
||||
public void Insert_hook() {
|
||||
this.Init();
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 1).Arg_("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 1).Val_str("name", "John Doe"));
|
||||
fx.tst_ExecRdrTbl(1, "dbs_crud_ops");
|
||||
fx.tst_RowAry(0, 1, "John Doe");
|
||||
}
|
||||
public void UpdateOne_hook() {
|
||||
this.Init();
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 1).Arg_("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 2).Arg_("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 1).Val_str("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 2).Val_str("name", "John Doe"));
|
||||
|
||||
fx.tst_ExecDml(1, Db_qry_.update_common_("dbs_crud_ops", Db_crt_.eq_("id", 2), KeyVal_.new_("name", "Jane Smith")));
|
||||
fx.tst_ExecDml(1, Db_qry_.update_common_("dbs_crud_ops", Db_crt_.New_eq("id", 2), KeyVal_.new_("name", "Jane Smith")));
|
||||
fx.tst_ExecRdrTbl(2, "dbs_crud_ops");
|
||||
fx.tst_RowAry(0, 1, "John Doe");
|
||||
fx.tst_RowAry(1, 2, "Jane Smith");
|
||||
}
|
||||
public void UpdateMany_hook() {
|
||||
this.Init();
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 1).Arg_("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 2).Arg_("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 1).Val_str("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 2).Val_str("name", "John Doe"));
|
||||
|
||||
fx.tst_ExecDml(2, Db_qry_.update_common_("dbs_crud_ops", Db_crt_.eq_("name", "John Doe"), KeyVal_.new_("name", "Jane Smith")));
|
||||
fx.tst_ExecDml(2, Db_qry_.update_common_("dbs_crud_ops", Db_crt_.New_eq("name", "John Doe"), KeyVal_.new_("name", "Jane Smith")));
|
||||
fx.tst_ExecRdrTbl(2, "dbs_crud_ops");
|
||||
fx.tst_RowAry(0, 1, "Jane Smith");
|
||||
fx.tst_RowAry(1, 2, "Jane Smith");
|
||||
}
|
||||
public void DeleteOne_hook() {
|
||||
this.Init();
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 1).Arg_("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 2).Arg_("name", "Jane Smith"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 1).Val_str("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 2).Val_str("name", "Jane Smith"));
|
||||
|
||||
fx.tst_ExecDml(1, Db_qry_.delete_("dbs_crud_ops", Db_crt_.eq_("id", 2)));
|
||||
fx.tst_ExecDml(1, Db_qry_.delete_("dbs_crud_ops", Db_crt_.New_eq("id", 2)));
|
||||
fx.tst_ExecRdrTbl(1, "dbs_crud_ops");
|
||||
fx.tst_RowAry(0, 1, "John Doe");
|
||||
}
|
||||
public void DeleteMany_hook() {
|
||||
this.Init();
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 1).Arg_("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 2).Arg_("name", "Jane Smith"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 1).Val_str("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 2).Val_str("name", "Jane Smith"));
|
||||
|
||||
fx.tst_ExecDml(2, Db_qry_.delete_tbl_("dbs_crud_ops"));
|
||||
fx.tst_ExecRdrTbl(0, "dbs_crud_ops");
|
||||
}
|
||||
public void SelectLike_hook() {
|
||||
this.Init();
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 1).Arg_("name", "John Doe"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 1).Val_str("name", "John Doe"));
|
||||
|
||||
fx.tst_ExecRdr(1, Db_qry_.select_cols_("dbs_crud_ops", Db_crt_.like_("name", "John%")));
|
||||
fx.tst_ExecRdr(1, Db_qry_.select_cols_("dbs_crud_ops", Db_crt_.New_like("name", "John%")));
|
||||
fx.tst_RowAry(0, 1, "John Doe");
|
||||
}
|
||||
public void SelectLikeForFileName_hook() {
|
||||
this.Init();
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 1).Arg_("name", "file%"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 1).Arg_("name", "file|%"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 1).Arg_("name", "file test"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 1).Val_str("name", "file%"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 1).Val_str("name", "file|%"));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 1).Val_str("name", "file test"));
|
||||
|
||||
fx.tst_ExecRdr(1, Db_qry_.select_cols_("dbs_crud_ops", Db_crt_.like_("name", "file|%")));
|
||||
fx.tst_ExecRdr(1, Db_qry_.select_cols_("dbs_crud_ops", Db_crt_.New_like("name", "file|%")));
|
||||
fx.tst_RowAry(0, 1, "file%");
|
||||
}
|
||||
public void InsertUnicode_hook() {
|
||||
this.Init();
|
||||
String val = "Ω";
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 3).Arg_obj_type_("name", val, Db_val_type.Tid_nvarchar));
|
||||
Db_qry__select_cmd select = Db_qry_.select_val_("dbs_crud_ops", "name", Db_crt_.eq_("id", 3));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 3).Val_obj_type("name", val, Db_val_type.Tid_nvarchar));
|
||||
Db_qry__select_cmd select = Db_qry_.select_val_("dbs_crud_ops", "name", Db_crt_.New_eq("id", 3));
|
||||
Tfds.Eq(val, ExecRdr_val(select));
|
||||
|
||||
fx.tst_ExecDml(1, Db_qry_.update_("dbs_crud_ops", Db_crt_.Wildcard).Arg_obj_type_("name", val + "a", Db_val_type.Tid_nvarchar));
|
||||
fx.tst_ExecDml(1, Db_qry_.update_("dbs_crud_ops", Db_crt_.Wildcard).Val_obj_type("name", val + "a", Db_val_type.Tid_nvarchar));
|
||||
Tfds.Eq(val + "a", ExecRdr_val(select));
|
||||
}
|
||||
public void Backslash_hook() {
|
||||
this.Init();
|
||||
String val = "\\";
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Arg_("id", 3).Arg_("name", val));
|
||||
Tfds.Eq(val, ExecRdr_val(Db_qry_.select_val_("dbs_crud_ops", "name", Db_crt_.eq_("id", 3))));
|
||||
Tfds.Eq(val, ExecRdr_val(Db_qry_.select_val_("dbs_crud_ops", "name", Db_crt_.eq_("name", "\\"))));
|
||||
fx.tst_ExecDml(1, Db_qry_.insert_("dbs_crud_ops").Val_int("id", 3).Val_str("name", val));
|
||||
Tfds.Eq(val, ExecRdr_val(Db_qry_.select_val_("dbs_crud_ops", "name", Db_crt_.New_eq("id", 3))));
|
||||
Tfds.Eq(val, ExecRdr_val(Db_qry_.select_val_("dbs_crud_ops", "name", Db_crt_.New_eq("name", "\\"))));
|
||||
}
|
||||
String ExecRdr_val(Db_qry__select_cmd select) {return (String)select.ExecRdr_val(fx.Conn());}
|
||||
String ExecRdr_val(Db_qry__select_cmd select) {return (String)Db_qry_.Exec_as_obj(fx.Conn(), select);}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class DataTypes_base_fxt {
|
||||
conn.Rls_conn();
|
||||
}
|
||||
public void Select_hook(String floatStr) {
|
||||
DataRdr rdr = Db_qry_.select_tbl_("dbs_multiple_data_types").Exec_qry_as_rdr(conn);
|
||||
DataRdr rdr = conn.Exec_qry_as_old_rdr(Db_qry_.select_tbl_("dbs_multiple_data_types"));
|
||||
|
||||
rdr.MoveNextPeer();
|
||||
Tfds.Eq(rdr.ReadInt("unique_id"), 1);
|
||||
@@ -70,9 +70,9 @@ class DataTypes_base_fxt {
|
||||
Tfds.Eq_decimal(rdr.ReadDecimal("amount"), Decimal_adp_.parts_(12, 345));
|
||||
}
|
||||
public void UpdateDate_hook() {
|
||||
conn.Exec_qry(Db_qry_.update_("dbs_multiple_data_types", Db_crt_.eq_("unique_id", 1)).Arg_obj_("last_update", DateAdpClassXtn.Instance.XtoDb(DateAdp_.parse_gplx("20091115 220000.000"))));
|
||||
conn.Exec_qry(Db_qry_.update_("dbs_multiple_data_types", Db_crt_.New_eq("unique_id", 1)).Val_obj("last_update", DateAdpClassXtn.Instance.XtoDb(DateAdp_.parse_gplx("20091115 220000.000"))));
|
||||
|
||||
DataRdr rdr = Db_qry_.select_tbl_("dbs_multiple_data_types").Exec_qry_as_rdr(conn);
|
||||
DataRdr rdr = conn.Exec_qry_as_old_rdr(Db_qry_.select_tbl_("dbs_multiple_data_types"));
|
||||
rdr.MoveNextPeer();
|
||||
Tfds.Eq_date(rdr.ReadDate("last_update"), DateAdp_.parse_gplx("20091115 220000.000"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user