A relation line.
Syntax:
<class>: <property>=<value>[ <value> <value>], <property>=..., ...
Properties:
relation = <object|list|reversed> [composite] [tracked] [referenced] [processed] [readonly|writeonly|nomethod]
[serialized] [transientonsave] [reversed]
- object: single object association. This is the default.
- reversed: non-composite list relation that contains max. one object (reversed 1:1 object relation)
- list: list of objects.
- composite: relation points to a component
- tracked: modification state of object or list is tracked
- referenced: set the parent reference on select and construction
- processed: invokes a processXXX-method on initialization, after select and before save
- readonly: don't generate set-method
- writeonly: don't generate get-method
- nomethod: don't generate set- and get-method (shorthand for readonly writeonly)
- serialized (only if lazy and not composite): lazy non-composite references are transient by default. "serialized" makes them non-transient.
- transientonsave: clear serialized relation before save (i.e. sending to server)
If the relation is associated to an attribute the readonly and writeonly flags are overwritten
by the attribute.
select = <always|eager|lazy> [main] [cached] [wurbletargs]
- always: fetched on every get (default if cached)
- eager: fetched in advance whenever the main class is fetched
- lazy: fetched within the first get only (default if not cached)
- main: invoke method in main class, not in <class>
- cached: use caching select methods if possible (only for objects-relations)
- wurbletargs: additional arguments passed to the PdoSelectList-wurblet (only for list-relations)
Example: select = lazy | -pilePosition
delete = [main] [cascade]
- main: invoke method in main class, not in <class>
- cascade: composition is a list that contains compositions
link = <name-of-link-method> [index]
- only for composite relations: special method to set the links in composite lists or objects
in saveReferencingRelations.
The methods arguments are fixed to (this).
-
[index] is an integer attribute of the referenced entity.
If [index] is set, (this, ndx) is invoked with index beginning at 0 (only for lists).
args = <arg1> [<arg2> <arg3> ... <argN>]
- arg: arguments to pass to invoked method.
If missing, defaults to "args=id" for lists and "args=<name>Id" for objects (see name below).
method = <methodname>
- methodname: is the part of the method names, i.e. select[By]<methodname>, delete[By]<methodname>, set<methodname>
[By] is added for lists.
name = <name>
- name: name of the attribute in main class. Defaults to <class>.
scope = <public|private|protected|package>
- sets the scope of the generated setter/getter-methods. Defaults to public.
comment = <comment>
- to include in getter/setter comment
By default the get- and set-names are generated as follows:
get<class> and set<class> (always first letter in uppercase) for object-relations and
get<class>List, set<class>List for list-relations.
If <name> is explicitly set, the methods will be named get<name> and set<name>
regardless of the relation type.