Database / Geography & VO

worknodehierarchy

Parent-child edges of the geography tree. Each row embeds the full parent and child WorkNode.

Table factsheetagri_db
Written by
  • Legacy setup (Repo.saveWorkNodeList)
  • Repo.saveWorkNodeHierarchyList (deletes all worknode tables, then re-inserts)
  • SetUpWorknode.kt
  • Data down-sync paging progress
Read by
  • Work-node selection on login (SelectWorkNodeRepositoryImpl)
  • VO lists (Activity tracker, endorsement)
  • IeRepositoryImpl.getVillageCode
  • DataUtil.changeLabelsByLanguage
Filled from
POST api/setupdata/v2 (WorkNodeDTO, WorkNodeHierarchyDTO)
GET gateway/commons-report-service/api/v1/datasets/name/PlusOneUrviGeoDataForVOs/execute
Sync
Has appId/opId/syncStatus from BaseEntity, but rows are download-only: syncStatus stays SYNC_DONE and opId is unused.
Source
data/src/main/java/org/mindtree/app/agricultor/data/entity/WorkNodeHierarchy.kt

Columns

ColumnTypeNullKeyMeaning
idINTEGERNoServer id. Null or 0 until the row is synced.
isActiveINTEGERNoSoft-delete flag (1 = active).
tenantINTEGERNoTenant id.
appIdTEXTNoPKClient-side UUID. Defaults to a random UUID when the object is built, including when server JSON is parsed.
opIdTEXTYesId of the last queued operation in the library queue (SYNC_QUEUE_DB).
syncStatusTEXTNoSYNC_NOT_INITIALIZED | IN_SYNC_QUEUE | SYNC_DONE (default).
parentworknode_isActiveINTEGERYesActive flag of the embedded object.
parentworknode_idINTEGERYesServer id of the embedded object.
parentworknode_aliasIdTEXTYesParent node: alias id.
parentworknode_tenantINTEGERYesParent node: tenant.
parentworknode_entityIDINTEGERYesParent node: entity id.
parentworknode_totalIEPagesINTEGERYesParent node: total IE pages.
parentworknode_pulledIEPagesINTEGERYesParent node: pulled IE pages.
parentworknode_totalCBPagesINTEGERYesParent node: total CB pages.
parentworknode_pulledCBPagesINTEGERYesParent node: pulled CB pages.
parentworknode_appIdTEXTNoEmbedded copy of the nested object's local appId.
parentworknode_opIdTEXTYesEmbedded copy of the nested object's opId.
parentworknode_syncStatusTEXTNoEmbedded copy of the nested object's sync status.
parentworknode_majortype_codeTEXTYesReference data code.
parentworknode_entitytype_codeTEXTYesReference data code.
parentworknode_contextcode_codeTEXTYesReference data code.
worknode_isActiveINTEGERYesActive flag of the embedded object.
worknode_idINTEGERYesServer id of the embedded object.
worknode_aliasIdTEXTYesChild node: business alias (stable cross-system id).
worknode_tenantINTEGERYesChild node: server tenant id.
worknode_entityIDINTEGERYesChild node: linked entity id.
worknode_totalIEPagesINTEGERYesChild node: total pages of farmers to download.
worknode_pulledIEPagesINTEGERYesChild node: farmer pages downloaded so far.
worknode_totalCBPagesINTEGERYesChild node: total pages of compact blocks.
worknode_pulledCBPagesINTEGERYesChild node: compact block pages downloaded so far.
worknode_appIdTEXTNoEmbedded copy of the nested object's local appId.
worknode_opIdTEXTYesEmbedded copy of the nested object's opId.
worknode_syncStatusTEXTNoEmbedded copy of the nested object's sync status.
worknode_majortype_codeTEXTYesReference data code.
worknode_entitytype_codeTEXTYesReference data code.
worknode_contextcode_codeTEXTYesReference data code.

Notes

  • 36 columns: two whole WorkNodes are flattened into every edge.
  • getWorkNodeByVillageId returns children of a village (default parent type MAJOR_TYPE.VILLAGE).
  • Possible bug · unverified getWorkNodeIdByParentIdAndTypeAndChildTypeTemp hardcodes id < 161497 (unused).