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

public abstract class SyntityMeta extends SemanticTableMeta
Syncrhonizable entity table meta
Since:
1.4.25
Author:
odys-z@github.com
  • Field Details

    • io_oz_synuid

      public final String io_oz_synuid
      Global syn-uid. Must be transparent to users. (using this field in transactions will suppress semantics handling of smtyp.synchange)
    • device

      public String device
    • uids

      public final ArrayList<String> uids
      Entity's columns for generation global uid
  • Constructor Details

    • SyntityMeta

      public SyntityMeta(String tbl, String pk, String devid, String conn)
      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

      public static final String err_requires_synuid(String tabl, String syn_uid, String conn)
    • autopk

      public boolean autopk()
    • autopk

      public SyntityMeta autopk(boolean ak)
    • replace

      public <T extends SemanticTableMeta> T replace() throws io.odysz.transact.x.TransException, SQLException
      Description copied from class: SemanticTableMeta
      Explicitly call this after this meta with semantics is created, to replace auto found meta from database, which is managed by Connects.
      Overrides:
      replace in class SemanticTableMeta
      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 by entCols().
      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, ...
      before
      insert 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 (or DBSyntableBuilder) 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 parameter select.
        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 called Query.cols(String...), etc. alrady.
      Returns:
      select
      Throws:
      io.odysz.transact.x.TransException
      SQLException
      See Also:
      • ExessionPersist.chpage()
    • synuid

      public String synuid(AnResultset rs)