Skip to content

Commit

Permalink
fix: Menu Tree with parent id NULL as Zero. (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Dec 5, 2024
1 parent c171a01 commit 5c69f62
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ private List<TreeNodeReference> getChildren(int treeId, int parentId) {
final String sql = "SELECT tn.Node_ID, tn.SeqNo "
+ "FROM " + tableName + " tn "
+ "WHERE tn.AD_Tree_ID = ? "
+ "AND tn.Parent_ID = ?";
+ "AND COALESCE(tn.Parent_ID, 0) = ?"
;
List<Object> parameters = new ArrayList<Object>();
parameters.add(treeId);
parameters.add(parentId);
Expand Down Expand Up @@ -91,6 +92,7 @@ public MenuTree withNode(MTree tree) {
documentDetail.put("internal_id", tree.getAD_Tree_ID());
documentDetail.put("id", tree.getUUID());
documentDetail.put("uuid", tree.getUUID());
documentDetail.put("name", tree.getName());
List<Map<String, Object>> childrenAsMap = new ArrayList<>();
children.forEach(child -> {
Map<String, Object> nodeAsMap = convertNode(child);
Expand Down

0 comments on commit 5c69f62

Please sign in to comment.