Package io.odysz.semantic.meta
Class SyntityMeta
java.lang.Object
io.odysz.semantics.meta.TableMeta
io.odysz.semantic.meta.SemanticTableMeta
io.odysz.semantic.meta.SyntityMeta
- All Implemented Interfaces:
XMLTable.IMapValue
- Direct Known Subclasses:
ExpDocTableMeta
,SynodeMeta
Syncrhonizable entity table meta
- Since:
- 1.4.25
- Author:
- odys-z@github.com
-
Field Summary
Modifier and TypeFieldDescriptionfinal String
Global syn-uid.Entity's columns for generation global uidFields inherited from class io.odysz.semantics.meta.TableMeta
conn, ddlSqlite, debug, ftypes, pk, tbl
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
autopk()
autopk
(boolean ak) static final String
err_requires_synuid
(String tabl, String syn_uid, String conn) insertChallengeEnt
(String uids, AnResultset challents) Generate data for value clause of the Insert statement, using columns for filter out fields of entity table.io.odysz.transact.sql.Query
onselectSyntities
(io.odysz.transact.sql.Query select) Entity meta's query event handler, while synchronizing.<T extends SemanticTableMeta>
Treplace()
Explicitly call this after this meta with semantics is created, to replace auto found meta from database, which is managed byConnects
.synuid
(AnResultset rs) updateEntNvs
(SynChangeMeta chgm, String entid, AnResultset entities, AnResultset challenges) Generate set values for the Update statement which is used for updating current entity, e.g.Methods inherited from class io.odysz.semantic.meta.SemanticTableMeta
loadSqlite, mapKey, setupSqlitables, setupSqliTables
Methods inherited from class io.odysz.semantics.meta.TableMeta
clone, col, col, col, coltype, conn, conn, constrain, constrain, ftypes, isQuoted, typesInited
-
Field Details
-
io_oz_synuid
Global syn-uid. Must be transparent to users. (using this field in transactions will suppress semantics handling of smtyp.synchange) -
device
-
uids
Entity's columns for generation global uid
-
-
Constructor Details
-
SyntityMeta
- Parameters:
tbl
-pk
-devid
- synode-id field uses this to filter data for synchronization. Could be changed in the future.conn
-
-
-
Method Details
-
err_requires_synuid
-
autopk
public boolean autopk() -
autopk
-
replace
public <T extends SemanticTableMeta> T replace() throws io.odysz.transact.x.TransException, SQLExceptionDescription copied from class:SemanticTableMeta
Explicitly call this after this meta with semantics is created, to replace auto found meta from database, which is managed byConnects
.- Overrides:
replace
in classSemanticTableMeta
- Returns:
- this
- Throws:
io.odysz.transact.x.TransException
SQLException
-
insertChallengeEnt
public ArrayList<Object[]> insertChallengeEnt(String uids, AnResultset challents) throws SQLException, SemanticException Generate data for value clause of the Insert statement, using columns for filter out fields of entity table. Columns are provided byentCols()
.Note:
This method will ignore auto-key field- Returns:
- values as arguments for calling Insert.value(), the row for the change log
- Throws:
SQLException
SemanticException
- Since:
- 1.4.40
-
updateEntNvs
public ArrayList<Object[]> updateEntNvs(SynChangeMeta chgm, String entid, AnResultset entities, AnResultset challenges) throws SemanticException, SQLException Generate set values for the Update statement which is used for updating current entity, e.g.update t set c = v1, ...
beforeinsert into t select 'item-a', 'item-b' where not exists select 1 from t where condition-avoiding-duplicate
org- Parameters:
entid
-entities
-challenges
-- Returns:
- n-v pairs for argument of
Update.nvs(ArrayList)
- Throws:
SQLException
SemanticException
-
onselectSyntities
public io.odysz.transact.sql.Query onselectSyntities(io.odysz.transact.sql.Query select) throws io.odysz.transact.x.TransException, SQLException Entity meta's query event handler, while synchronizing.
ExessionPersist
(orDBSyntableBuilder
) use this for loading entities in a syn-exchang page.Note: call select.cols(...) first.
A typical task finished here is to add an extFile() function object to the parameterselect
.T_DA_PhotoMet entm = new T_DA_PhotoMet(conn); // extends SyntityMeta AnResultset entities = ((AnResultset) entm .onselectSyntities(trb.select(tbl, "e").col("e.*"))
- Parameters:
select
- typically should already calledQuery.cols(String...)
, etc. alrady.- Returns:
- select
- Throws:
io.odysz.transact.x.TransException
SQLException
- See Also:
-
ExessionPersist.chpage()
-
synuid
-