Skip to content

How to make calculable property

Ilia Naryzhny edited this page Mar 15, 2015 · 2 revisions

It's very simple to create calculable property!

  1. Create new property as usual
  2. Mark property "Calculable"
  3. Specify script for value calculation

Calculation Script

Script is OrientDB SQL, but actual value should be in column named "value".

Examples:

select sum(a, b) as value from MyClass where @rid = ?
select sum(e.salery) as value from Employee e where e.department = ? 

In case of calculation just for a current row you can use short notation:

sum(a, b)

instead of

select sum(a, b) as value from MyClass where @rid = ?