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
- Legacy setup (
- Read by
- Work-node selection on login (
SelectWorkNodeRepositoryImpl) - VO lists (Activity tracker, endorsement)
IeRepositoryImpl.getVillageCodeDataUtil.changeLabelsByLanguage
- Work-node selection on login (
- 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
| Column | Type | Null | Key | Meaning |
|---|---|---|---|---|
id | INTEGER | No | Server id. Null or 0 until the row is synced. | |
isActive | INTEGER | No | Soft-delete flag (1 = active). | |
tenant | INTEGER | No | Tenant id. | |
appId | TEXT | No | PK | Client-side UUID. Defaults to a random UUID when the object is built, including when server JSON is parsed. |
opId | TEXT | Yes | Id of the last queued operation in the library queue (SYNC_QUEUE_DB). | |
syncStatus | TEXT | No | SYNC_NOT_INITIALIZED | IN_SYNC_QUEUE | SYNC_DONE (default). | |
parentworknode_isActive | INTEGER | Yes | Active flag of the embedded object. | |
parentworknode_id | INTEGER | Yes | Server id of the embedded object. | |
parentworknode_aliasId | TEXT | Yes | Parent node: alias id. | |
parentworknode_tenant | INTEGER | Yes | Parent node: tenant. | |
parentworknode_entityID | INTEGER | Yes | Parent node: entity id. | |
parentworknode_totalIEPages | INTEGER | Yes | Parent node: total IE pages. | |
parentworknode_pulledIEPages | INTEGER | Yes | Parent node: pulled IE pages. | |
parentworknode_totalCBPages | INTEGER | Yes | Parent node: total CB pages. | |
parentworknode_pulledCBPages | INTEGER | Yes | Parent node: pulled CB pages. | |
parentworknode_appId | TEXT | No | Embedded copy of the nested object's local appId. | |
parentworknode_opId | TEXT | Yes | Embedded copy of the nested object's opId. | |
parentworknode_syncStatus | TEXT | No | Embedded copy of the nested object's sync status. | |
parentworknode_majortype_code | TEXT | Yes | Reference data code. | |
parentworknode_entitytype_code | TEXT | Yes | Reference data code. | |
parentworknode_contextcode_code | TEXT | Yes | Reference data code. | |
worknode_isActive | INTEGER | Yes | Active flag of the embedded object. | |
worknode_id | INTEGER | Yes | Server id of the embedded object. | |
worknode_aliasId | TEXT | Yes | Child node: business alias (stable cross-system id). | |
worknode_tenant | INTEGER | Yes | Child node: server tenant id. | |
worknode_entityID | INTEGER | Yes | Child node: linked entity id. | |
worknode_totalIEPages | INTEGER | Yes | Child node: total pages of farmers to download. | |
worknode_pulledIEPages | INTEGER | Yes | Child node: farmer pages downloaded so far. | |
worknode_totalCBPages | INTEGER | Yes | Child node: total pages of compact blocks. | |
worknode_pulledCBPages | INTEGER | Yes | Child node: compact block pages downloaded so far. | |
worknode_appId | TEXT | No | Embedded copy of the nested object's local appId. | |
worknode_opId | TEXT | Yes | Embedded copy of the nested object's opId. | |
worknode_syncStatus | TEXT | No | Embedded copy of the nested object's sync status. | |
worknode_majortype_code | TEXT | Yes | Reference data code. | |
worknode_entitytype_code | TEXT | Yes | Reference data code. | |
worknode_contextcode_code | TEXT | Yes | Reference 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).