jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
613 stars 122 forks source link

Research: using parent-child hierarchy instead of 'fullPath' field #2003

Open Gavrilov-Ivan opened 1 year ago

Gavrilov-Ivan commented 1 year ago

Research posibility to get rid of fullPath field in WebdavDocument. It contains the full path to this resource in view of hierarchy. Main usecases: search for child documents during operations over parent - copy, move, rename, remove. It's also used as resource URI within webdav client communication (e.g. Windows Explorer).

Main concerns:

  1. It's CLOB - causes some limitations\issues on some databases (e.g. error with 'like' clause on hsqldb - #1540, equal clause issue in Oracle - #643).
  2. Stored value is encoded the URI-compatible way - causes issues with queries and encoding\decoding for different cases (links, explorer, etc), difficult to support.

Entity already has parent field so it can be used to work with documents in terms of proper hierarchy. Need to research if it's possible to reproduce all logic using parent-child hierarchy without performance or any other issues or limitations.

gmmars commented 4 months ago

FullPath field is used in many services so it cannot be removed without complete redesign of service layer Using ID in fullPath instead of filename was proposed as an alternative solution for solving any non-standard symbol and encoding problems. But one of the drawback of the proposed solution is that it will lead to an unreadable by user eye file name (ID instead of filename).