I'm researching OrientDB in order to evaluate versioning capabilities of graph databases.
Each record in OrientDB has a @version property which increases every time a record is updated. This indicates support for versioning. I've set up a simple example (using OrientDB SQL) to test this:
create class Product
create property Product.name string
create property Product.price integer
insert into Product (name, price) values ('Fridge', 449)
update Product set price = 479 where name = 'Fridge'
select from Product
After executing the statements above, I get the following query result:
{
"result": [
{
"@type": "d",
"@rid": "#14:0",
"@version": 2,
"@class": "Product",
"name": "Fridge",
"price": 479
}
],
"notification": "Query executed in 0.031 sec. Returned 1 record(s)"
}
In this database state - how can I retrieve a previous version (version 1 in this simple case) of my record? Is this possible through an OrientDB SQL statement and/or via the OrientDB Java API? If not - what's the purpose of the @version property then?