diff --git a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java index a15fa029b59..63f673db2bb 100644 --- a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java +++ b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java @@ -754,6 +754,13 @@ public void setChildren(Set children) { this.children = children; } + /** + * Note that the {@code path} is mapped with the "property access" mode. This method will + * recalculate and return the path property value. To access the {@code path} property directly, + * use {@link OrganisationUnit#getPathPersisted}. + * + * @return the recalculated path. + */ @JsonProperty @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0) public String getPath() { @@ -785,6 +792,17 @@ public void setPath(String path) { this.path = path; } + /** + * Note that the {@code path} is mapped with the "property access" mode. This method will return + * the persisted {@code path} property directly. To get the recalculated path value, use {@link + * OrganisationUnit#getPath}. + * + * @return the persisted path. + */ + public String getPathPersisted() { + return path; + } + /** * Used by persistence layer. Purpose is to have a column for use in database queries. For * application use see {@link OrganisationUnit#getLevel()} which has better performance.