Is it possible to update the class for a record in OrientDB after creating the record?

StackOverflow https://stackoverflow.com/questions/21524986

  •  06-10-2022
  •  | 
  •  

문제

I am creating Schema under Graph Database in OrientDB. I am creating a class Entity with few fields. Entity can be changed in the functional life cycle to StageOneEntity. So I created one more class StageOneEntity which extends Entity class.

If I create a record using class Entity, can I change the class to StageOneEntity afterwards?

도움이 되었습니까?

해결책

No, the class is assigned on creation and never can be changed, unless you copy the object but it would have a different RID.

다른 팁

YES, it is possible:

MOVE VERTEX #34:232 TO CLASS:StageOneEntity

or

MOVE VERTEX (SELECT FROM `Entity`) TO CLASS:StageOneEntity

to change class of all Entity records

https://orientdb.com/docs/last/SQL-Move-Vertex.html

It is possible only for vertices (not edges) according to documentation. I had found no notes about MOVE EDGE command.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top