Skip to content

entities: use customize uuid as unique identifier

Motivation:

Currently, we use neo4j internal id as cerebrum identifier. This implementation, that is, using neo4j internal id present couple of problems:

  1. since neo4j id is an internal implementation, this should not be expose to the user

  2. also, neo4j does not allow modification of the id after creation.

Hence, there is a need to create a new strategy for unique identifier within cerebrum.

Modification:

  • create a custom uuid generator: basically this contain a prefix based on the entity and a uuid of type 1.
  • adjust maketuser and organization entity to use the custom uuid. This will be auto generated if it is not set and if set, the validity will be check before creating the entity.
  • change id to uuid in the organisation controller and the cerbrum-entity-not-found exception.

Result:

uuid now replace id inside cerebrum. PATCH method now function as it suppose to.

Target: master Acked-by: Review: https://gitlab.hzdr.de/hifis-technical-platform/helmholtz-cerebrum/-/merge_requests/13

Merge request reports