public static enum DASemantics.smtype extends Enum<DASemantics.smtype>
autoInc
fkIns
fkCateIns
fullpath
defltVal
parentChildrenOnDel
parentChildrenOnDelByCate
dencrypt
opTime
checkSqlCountOnDel
checkSqlCountOnInsert
postFk
extFile
extFilev2
synChange
Enum Constant and Description |
---|
autoInc
Auto Key
xml/smtc = "auto" | "pk" | "a-k" | "autopk" Generate auto increased value for the field when inserting. on-events: insert |
checkSqlCountOnDel
"ck-cnt-del" | "check-count-del" | "checksqlcountondel":
check is this record a referee of children records - results from sql.select(count, description-args ...). |
checkSqlCountOnInsert
"ck-cnt-ins" | "check-count-ins" | "checksqlcountoninsert":
Check is this record count when inserting - results from sql.select(count-sql, description-args ...). |
defltVal
xml/smtc = "dv" | "d-v" | "dfltVal":
Handler: DASemantics.ShDefltVal |
dencrypt
"d-e" | "de-encrypt" | "dencrypt":
decrypt then encrypt (target col cannot be pk or anything other semantics will updated Handler: DASemantics.ShDencrypt |
dencryptOnRead
Deprecated.
to be implemented: new semantics handler: de-encrypt field on reading (in case client
requiring read plain password etc. by accident.
|
extFile
Deprecated.
this is the same with
extFilev2 |
extFilev2
Save and load a special field as file of file system.
|
fkCateIns
xml/smtc = "fkc" | "f-i-c" | "fk-ins-cate"
|
fkIns
xml/smtc = "fk" | "pkref" | "fk-ins"
|
fullpath
xml/smtc = "f-p" | "fp" | "fullpath":
|
opTime
xml/smtc = "o-t" | "oper-time" | "optime"
Finger printing session user's db updating - record operator / oper-time Handler: DASemantics.ShOperTime |
parentChildrenOnDel
"pc-del-all" | "parent-child-del-all" | "parentchildondel"
|
parentChildrenOnDelByCate
"pc-del-tbl" | "pc-del-by-tbl" | "pc-tbl"
|
postFk
"p-f" | "p-fk" | "post-fk"
|
synChange
xml/smtc = "syn-change" | "s-c"
Logging table changes for DB synchronizing. |
Modifier and Type | Method and Description |
---|---|
static DASemantics.smtype |
parse(String type)
Convert string key to
DASemantics.smtype . |
static DASemantics.smtype |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DASemantics.smtype[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DASemantics.smtype autoInc
args: [0]: pk-field; [1]: optional, pk-prefix (since 1.4.35)
Handler:DASemantics.ShAutoK
public static final DASemantics.smtype fkIns
Automatically fill fk when inserting. Only referenced auto pk can be resolved.
args: 0 referencing col, 1 parent table, 2 parent pk
Handler:DASemantics.ShFkOnIns
public static final DASemantics.smtype fkCateIns
Automatically fill merged child fk when inserting. Only referenced auto pk can be resolved.
About Merged Child Table:
Take the attachements table for external file's information for example,
the a_attaShExtFileches(See
sqlite test DB) has a field, named 'busiId', referencing multiple parent table.
The parent table is distinguished with filed busiTbl.
args: 0 business cate (table name); 1 merged child fk; 2 parent table, 3 parent referee [, ...]
Handler:DASemantics.ShFkInsCates
public static final DASemantics.smtype fullpath
args: 0: parent Id field, 1: sibling/sort field (optional), 2: fullpath field, 3: sort size (optional, default 2)
where sort size is the digital length for formatting fullpath string.
DASemantics.ShFullpath
public static final DASemantics.smtype defltVal
DASemantics.ShDefltVal
public static final DASemantics.smtype parentChildrenOnDel
args: [pc-define, ...], where pc-define is a space sperated strings: pc-define[0] name or child referencing column, e.g. domainId for a_domain.domainId pc-define[1] child table, e.g. a_orgs pc-define[2] child fk (or condition columnr), e.g. orgType Example: domainId a_orgs orgType, ... When deleting a_domain, the sql of the results shall be: delete from a_orgs where orgType in (select domainId from a_domain where domainId = '000001') where the 'where clause' in select clause is composed from condition of the delete request's where condition.Handler:
DASemantics.ShPCDelAll
public static final DASemantics.smtype parentChildrenOnDelByCate
args: [pc-define, ...], where pc-define is a space sperated strings: pc-define[0] name or child referencing column (a_domain.domainId's value will be used) pc-define[1] child table pc-define[2] child fk (or condition column) pc-define[3] child cate (e.g. table name) Example: domainId a_orgs orgType, ... The sql of the results shall be: delete from a_orgs where orgType in (select domainId from a_domain where domainId = '000001') where the 'where clause' in select clause is composed from condition of the delete request's where condition.Handler:
DASemantics.ShPCDelByCate
public static final DASemantics.smtype dencrypt
DASemantics.ShDencrypt
public static final DASemantics.smtype dencryptOnRead
public static final DASemantics.smtype opTime
DASemantics.ShOperTime
public static final DASemantics.smtype checkSqlCountOnDel
[0] name or child referencing column (a_domain.domainId's value will be used) [1] child table [2] child pk (or condition column) Example: domainId a_orgs orgType, ... The sql of the results shall be: select count(orgType) from a_orgs where orgType in (select domainId from a_domain where domainId = '000001') where the 'where clause' in select clause is composed from condition of the delete request's where condition.where args are column name of parent table. Handler:
DASemantics.ShChkCntDel
public static final DASemantics.smtype checkSqlCountOnInsert
args: [0] arg1, [1] arg2, ..., [len -1] count-sql with "%s" formatter
where args are column name of parent table.
DASemantics.ShChkCntDel
public static final DASemantics.smtype postFk
semantics:
post fk wire back - parent has an fk to child (only one
child makes sense, like making cross refs)
Note:
This semantics works only when previously resolved auto key exists; if the
value doesn't exist, will be ignored.
The former is the case of inserting new child, and parent refer to it;
the later is the case of updating a child, the parent already has it's pk,
nothing should be done.
r
Further Discussion:
As cross reference is not a good ideal, this semantics sometimes leads to
trouble. Any suggestion or comments are welcome.
args: 0 referencing col, 1 target table, 2 target pk(must be an auto key)
Handler:DASemantics.ShPostFk
public static final DASemantics.smtype extFile
extFilev2
args
0: uploads (relative or start with $env_var),
1: uri,
2: busiTbl, the folder name, e.g. "a_users", or "month"
3: busiId, the recored value used for sub folder
4: client-name (optional)
See handler for args' details: DASemantics.ShExtFile
On updating external files handler.
This method throw an exception if the uri provided, applying the semantics predefined as:
AS all files are treaded as binary file, no file can be modified, only delete then create it makes sense.
Client should avoid updating an external file while handling business logics.
However, since v1.3.9, the updating file path is suppored via ExtFileUpdate
.
NOTE: This semantics only guard the data for updating.
To replace uri back into file when selecting, use "extfile(uri)" (js) or sqlExtFile(uri)
in java.
public static final DASemantics.smtype extFilev2
Save and load a special field as file of file system.
The file content should be a Base 64 encoded block.
This semantics only used for handling small files. If the file is large, there are an example in Semantic.jserv which uses a block sequence for uploading files.
args:
0: rec-id
1: uri, the Base64 content
2: subfolder
3: ...
-1: file name
extFile
, but can handle more subfolder (configered in xml as field name of data table).public static final DASemantics.smtype synChange
args
0: full qualified name of table meta
1: global identity fields, separated with space, e.g. "synoder clientpath"
2: [deprecated] fields to be cleared (optional with empty value), separated with space
public static DASemantics.smtype[] values()
for (DASemantics.smtype c : DASemantics.smtype.values()) System.out.println(c);
public static DASemantics.smtype valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static DASemantics.smtype parse(String type) throws SemanticException
DASemantics.smtype
.
Note: we don't use enum.valueOf(), because of fault / fuzzy tolerate.type
- DASemantics.smtype
SemanticException
Copyright © 2024. All rights reserved.