The following example defines a unidirectional many-to-one relationship:
The following error will be shown for setEmployeeListRef method:
In this case, 'xxx' is 'departmentRef'.
As the message says, define employeeListRef field and replace 'xxx' with 'departmentRef'. If you do not use GWT, you can use EmployeeMeta.get().departmentRef.getName() type-safely instead of "departmentRef".
You can specify sort order as follows:
If you do not use GWT, you can use EmployeeMeta.get().salary.getName() type-safely instead of "salary".
Then delete setEmployeeListRef method.
Now let's create employees and a department.
You can get a department and employees. The relationship is loaded lazily.