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
  •  | 
  •  

Pergunta

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?

Foi útil?

Solução

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

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top