mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.4.1.1'
This commit is contained in:
@@ -18,10 +18,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.dbs.cfgs; import gplx.*; import gplx.dbs.*;
|
||||
import gplx.core.primitives.*;
|
||||
public class Db_cfg_tbl implements Rls_able {
|
||||
private final String tbl_name; private final Dbmeta_fld_list flds = Dbmeta_fld_list.new_();
|
||||
private final String fld_grp, fld_key, fld_val;
|
||||
private final String tbl_name; private final Dbmeta_fld_list flds = Dbmeta_fld_list.new_();
|
||||
private final String fld_grp, fld_key, fld_val;
|
||||
private Db_stmt stmt_insert, stmt_update, stmt_select;
|
||||
public Db_conn Conn() {return conn;} private final Db_conn conn;
|
||||
public Db_conn Conn() {return conn;} private final Db_conn conn;
|
||||
public Db_cfg_tbl(Db_conn conn, String tbl_name) {
|
||||
this.conn = conn; this.tbl_name = tbl_name;
|
||||
this.fld_grp = flds.Add_str("cfg_grp", 255);
|
||||
@@ -64,6 +64,8 @@ public class Db_cfg_tbl implements Rls_able {
|
||||
}
|
||||
public void Upsert_yn (String grp, String key, boolean val) {Upsert_str(grp, key, val ? "y" : "n");}
|
||||
public void Upsert_int (String grp, String key, int val) {Upsert_str(grp, key, Int_.To_str(val));}
|
||||
public void Upsert_date (String grp, String key, DateAdp val) {Upsert_str(grp, key, val.XtoStr_fmt_yyyyMMdd_HHmmss());}
|
||||
public void Upsert_guid (String grp, String key, Guid_adp val) {Upsert_str(grp, key, val.To_str());}
|
||||
public void Upsert_str (String grp, String key, String val) {
|
||||
String cur_val = this.Select_str_or(grp, key, null);
|
||||
if (cur_val == null) this.Insert_str(grp, key, val);
|
||||
|
||||
Reference in New Issue
Block a user