The pickList table defines values shown for a table in a selection list. This selection list is used in a drop down list selector (combobox) for reference (LINK) fields and all of the other reference based datatypes (LINKSET, LINKLIST, LINKMAP) The tablename field should specify the table name and the query field gives the OrientDB SQL query to produce an identifier (rid) and a name for the object. There is also a description field to allow you to document your pick list generator.
At installation, the pickList table will looks like this:
This list will ensure that any reference to an OIdentity (a role or a user) will give roles and users as options to pick. The description field explains how to change the pick list to only show roles.
Note that switching this does not affect any existing data, only the options given to users so you are encouraged to decide early if you are going to switch to user based privileges instead of role base privileges
If you just want to give a list of static values for a column, use Pick Values
The SQL should produce two columns, an identifer and a name (both strings). In the future, a third column may be added to support grouping.
Here is an example SQL:
SELECT @rid.asString(), description as name FROM testTable
Examples from the Course Registration example/tutorial:
SELECT @rid.asString(),format('%s %s',course.name,semester.name) as name FROM courseOffering
SELECT @rid.asString(),format('%s %s (%d students registered)',course.name,semester.name,students.size()) as name FROM courseOffering
SELECT @rid.asString(),format('%s - %s',courseOffering.course.name, student.name) as name FROM courseRegistration